From 4262ef4e11ae2c5dc0a8db980d4996c04731bc2b Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Mon, 23 Mar 2015 15:18:45 -0700 Subject: [PATCH] We can't spell check Russian without an LM. Change-Id: I635a51acc2e45aebe23a1cf69da1b5c72a6ac9e1 --- .../com/android/inputmethod/latin/InputTestsBase.java | 7 +++++-- .../spellcheck/AndroidSpellCheckerServiceTest.java | 10 ++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index f91adcd96..dead53da2 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -107,12 +107,15 @@ public class InputTestsBase extends ServiceTestCase { throw new RuntimeException("Expected one span, found " + spans.length); } } + public SuggestionSpan getSpan() { + return (SuggestionSpan) mSpan; + } public boolean isAutoCorrectionIndicator() { return (mSpan instanceof SuggestionSpan) && - 0 != (SuggestionSpan.FLAG_AUTO_CORRECTION & ((SuggestionSpan)mSpan).getFlags()); + 0 != (SuggestionSpan.FLAG_AUTO_CORRECTION & getSpan().getFlags()); } public String[] getSuggestions() { - return ((SuggestionSpan)mSpan).getSuggestions(); + return getSpan().getSuggestions(); } } diff --git a/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java b/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java index 2272d6ba0..e7c48da19 100644 --- a/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java +++ b/tests/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerServiceTest.java @@ -53,14 +53,8 @@ public class AndroidSpellCheckerServiceTest extends InputTestsBase { sleep(1000); final SpanGetter span = new SpanGetter(mEditText.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]); + // We don't ship with Russian LM + assertNull(span.getSpan()); } public void testSpellcheckWithPeriods() {