diff options
author | 2013-10-21 23:39:39 -0700 | |
---|---|---|
committer | 2013-10-21 23:39:39 -0700 | |
commit | 7d0d203d205433c098e46e56e265009c13dcdeb1 (patch) | |
tree | 2d6d7562a8d9de933e378138b45faea72838d9b2 /tests/src | |
parent | f099c7e3d3c378399626c975c54bd00b1b14d0f0 (diff) | |
parent | 238941991df521a6c120c6ff2e1a8ae46e8d4823 (diff) | |
download | latinime-7d0d203d205433c098e46e56e265009c13dcdeb1.tar.gz latinime-7d0d203d205433c098e46e56e265009c13dcdeb1.tar.xz latinime-7d0d203d205433c098e46e56e265009c13dcdeb1.zip |
am 23894199: am f356a25f: [DO NOT MERGE] Fix a bug where autocaps would jam auto-commit
* commit '238941991df521a6c120c6ff2e1a8ae46e8d4823':
[DO NOT MERGE] Fix a bug where autocaps would jam auto-commit
Diffstat (limited to 'tests/src')
-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() { |