aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-09 18:52:21 +0900
committerJean Chalard <jchalard@google.com>2014-06-10 19:52:58 +0900
commit4863a06544081bb4998f70cdb2e7c0e5c45fdd4c (patch)
tree4fbde2ddd7099b3c2df47fcb1531ca4b3c271139 /tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java
parent2d7feb5ad0131ac70c385278a29aa5503fdfe1eb (diff)
downloadlatinime-4863a06544081bb4998f70cdb2e7c0e5c45fdd4c.tar.gz
latinime-4863a06544081bb4998f70cdb2e7c0e5c45fdd4c.tar.xz
latinime-4863a06544081bb4998f70cdb2e7c0e5c45fdd4c.zip
Special case periods in the spell checker
Special case <valid word>.<valid word> to send as a suggestion the same string where the periods is replaced by a space. Bug: 10780091 Change-Id: I43c94675977f9ab5d7ee5671486cb742b39f3974
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java b/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java
index 995d7f07b..2272d6ba0 100644
--- a/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java
+++ b/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java
@@ -39,7 +39,7 @@ public class AndroidSpellCheckerServiceTest extends InputTestsBase {
// it yields 5).
assertTrue(suggestions.length >= 2);
// We also assume the top suggestion should be "this".
- assertEquals("", "this", suggestions[0]);
+ assertEquals("Test basic spell checking", "this", suggestions[0]);
}
public void testRussianSpellchecker() {
@@ -62,4 +62,21 @@ public class AndroidSpellCheckerServiceTest extends InputTestsBase {
// Russian dictionary.
assertEquals("", "года", suggestions[0]);
}
+
+ public void testSpellcheckWithPeriods() {
+ changeLanguage("en_US");
+ mEditText.setText("I'm.sure ");
+ mEditText.setSelection(mEditText.getText().length());
+ mEditText.onAttachedToWindow();
+ sleep(1000);
+ runMessages();
+ sleep(1000);
+
+ final SpanGetter span = new SpanGetter(mEditText.getText(), SuggestionSpan.class);
+ // If no span, the following will crash
+ final String[] suggestions = span.getSuggestions();
+ // The first suggestion should be "I'm sure".
+ assertEquals("Test spell checking of mistyped period for space", "I'm sure",
+ suggestions[0]);
+ }
}