diff options
author | 2013-10-21 14:40:32 +0900 | |
---|---|---|
committer | 2013-10-22 12:39:49 +0900 | |
commit | c6a121805f9d3ed62d1a32b198a685b902d9f92b (patch) | |
tree | 57bd63bcefeac8302b88a6e7aaef959a2370fcbc /tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java | |
parent | 859b117118afc78df12118a787d9341970b06363 (diff) | |
download | latinime-c6a121805f9d3ed62d1a32b198a685b902d9f92b.tar.gz latinime-c6a121805f9d3ed62d1a32b198a685b902d9f92b.tar.xz latinime-c6a121805f9d3ed62d1a32b198a685b902d9f92b.zip |
Fix a bug where autocaps would jam auto-commit
Bug: 11311002
Change-Id: I62955e364c9ffc75322cf05fa3ad7985f1d09259
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java index a594baf0b..375352067 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java +++ b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java @@ -25,6 +25,7 @@ import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; import java.util.Locale; +import java.util.Random; @SmallTest public class SuggestedWordsTests extends AndroidTestCase { @@ -72,15 +73,20 @@ public class SuggestedWordsTests extends AndroidTestCase { return new SuggestedWordInfo(s, 100, SuggestedWordInfo.KIND_TYPED, null /* sourceDict */, SuggestedWordInfo.NOT_AN_INDEX /* indexOfTouchPointOfSecondWord */, - SuggestedWordInfo.NOT_A_CONFIDENCE /* autoCommitFirstWordConfidence */); + new Random().nextInt(1000000) /* autoCommitFirstWordConfidence */); } // Helper for testGetTransformedWordInfo private SuggestedWordInfo transformWordInfo(final String info, final int trailingSingleQuotesCount) { - return Suggest.getTransformedSuggestedWordInfo(createWordInfo(info), + final SuggestedWordInfo suggestedWordInfo = createWordInfo(info); + final SuggestedWordInfo returnedWordInfo = + Suggest.getTransformedSuggestedWordInfo(suggestedWordInfo, Locale.ENGLISH, false /* isAllUpperCase */, false /* isFirstCharCapitalized */, trailingSingleQuotesCount); + assertEquals(suggestedWordInfo.mAutoCommitFirstWordConfidence, + returnedWordInfo.mAutoCommitFirstWordConfidence); + return returnedWordInfo; } public void testGetTransformedSuggestedWordInfo() { |