diff options
author | 2012-09-04 01:51:23 -0700 | |
---|---|---|
committer | 2012-09-04 01:51:23 -0700 | |
commit | 8561000d198e2f4fa09f6fe90984c983df268452 (patch) | |
tree | 2f281653dab626d24ee9c3946b8033ed1678fa8a /tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java | |
parent | 12b78258e6d61afba01966cd67cb756a69a92c47 (diff) | |
parent | 49894284bdbe36b6248e2fd0ba984e4709438f50 (diff) | |
download | latinime-8561000d198e2f4fa09f6fe90984c983df268452.tar.gz latinime-8561000d198e2f4fa09f6fe90984c983df268452.tar.xz latinime-8561000d198e2f4fa09f6fe90984c983df268452.zip |
am 49894284: Merge "Add a preliminary test for basic Russian spell check" into jb-mr1-dev
* commit '49894284bdbe36b6248e2fd0ba984e4709438f50':
Add a preliminary test for basic Russian spell check
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java b/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java index 11624e122..21406d370 100644 --- a/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java +++ b/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java @@ -40,4 +40,24 @@ public class AndroidSpellCheckerServiceTest extends InputTestsBase { // We also assume the top suggestion should be "this". assertEquals("", "this", suggestions[0]); } + + public void testRussianSpellchecker() { + changeLanguage("ru"); + mTextView.onAttachedToWindow(); + mTextView.setText("годп"); + type(" "); + sleep(1000); + runMessages(); + sleep(1000); + + final SpanGetter span = new SpanGetter(mTextView.getText(), SuggestionSpan.class); + // If no span, the following will crash + final String[] suggestions = span.getSuggestions(); + // For this test we consider "годп" should yield at least 2 suggestions (at this moment + // it yields 5). + assertTrue(suggestions.length >= 2); + // We also assume the top suggestion should be "года", which is the top word in the + // Russian dictionary. + assertEquals("", "года", suggestions[0]); + } } |