aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-05-26 18:45:32 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-05-26 21:56:20 +0900
commita6278eb9c1fbe102259cba392b1459f712ca46e7 (patch)
tree40d1acf7ee7c94baabaa6c17180c18531059ce65 /tests/src
parent4905d83270720ce9b9121595277dae6ba8102f16 (diff)
downloadlatinime-a6278eb9c1fbe102259cba392b1459f712ca46e7.tar.gz
latinime-a6278eb9c1fbe102259cba392b1459f712ca46e7.tar.xz
latinime-a6278eb9c1fbe102259cba392b1459f712ca46e7.zip
Use whether it's exact match to detect distracters.
Bug: 13142176 Change-Id: Id5b7286d28897931f7bfe571be45d46ffeef4adf
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/latin/DistracterFilterTest.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java b/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java
index 33f379467..a4dbfaa6b 100644
--- a/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java
+++ b/tests/src/com/android/inputmethod/latin/DistracterFilterTest.java
@@ -40,34 +40,31 @@ public class DistracterFilterTest extends InputTestsBase {
final PrevWordsInfo EMPTY_PREV_WORDS_INFO = PrevWordsInfo.EMPTY_PREV_WORDS_INFO;
final Locale localeEnUs = new Locale("en", "US");
- String typedWord = "alot";
- // For this test case, we consider "alot" is a distracter to "a lot".
- assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
- EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
+ String typedWord;
- typedWord = "mot";
- // For this test case, we consider "mot" is a distracter to "not".
+ typedWord = "google";
+ // For this test case, we consider "google" is a distracter to "Google".
assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
- typedWord = "wierd";
- // For this test case, we consider "wierd" is a distracter to "weird".
+ typedWord = "Bill";
+ // For this test case, we consider "Bill" is a distracter to "bill".
assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
- typedWord = "hoe";
- // For this test case, we consider "hoe" is a distracter to "how".
+ typedWord = "nOt";
+ // For this test case, we consider "nOt" is a distracter to "not".
assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
- typedWord = "nit";
- // For this test case, we consider "nit" is a distracter to "not".
+ typedWord = "were";
+ // For this test case, we consider "were" is a distracter to "we're".
assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
typedWord = "ill";
- // For this test case, we consider "ill" is a distracter to "I'll".
- assertTrue(mDistracterFilter.isDistracterToWordsInDictionaries(
+ // For this test case, we consider "ill" is not a distracter to any word in dictionaries.
+ assertFalse(mDistracterFilter.isDistracterToWordsInDictionaries(
EMPTY_PREV_WORDS_INFO, typedWord, localeEnUs));
typedWord = "asdfd";