aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-09-04 17:44:19 +0900
committerJean Chalard <jchalard@google.com>2012-09-04 17:47:44 +0900
commitc61bed6860cf047e4ef7fd851ae82727ac230440 (patch)
treed8bc7a053b90a73127bf100bcad68dbf5347d0ec /tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java
parent5d96585a388a0af8bf0e37fc38ed3d2630733ab9 (diff)
downloadlatinime-c61bed6860cf047e4ef7fd851ae82727ac230440.tar.gz
latinime-c61bed6860cf047e4ef7fd851ae82727ac230440.tar.xz
latinime-c61bed6860cf047e4ef7fd851ae82727ac230440.zip
Add a preliminary test for basic Russian spell check
Bug: 6981919 Change-Id: I5ec6a6468cb616e7a4369c79b4dbfc84f3d8de59
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java20
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]);
+ }
}