diff options
author | 2014-09-08 18:31:54 +0900 | |
---|---|---|
committer | 2014-09-08 21:54:28 +0900 | |
commit | b41ee671944aee97163c1567d7407fc3bd7507a3 (patch) | |
tree | 5c73261877d4a3ea361c1900a92e1eb4081ab728 /tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java | |
parent | c106efa7cd6a6fad3a45ff42f49a54b8a370587f (diff) | |
download | latinime-b41ee671944aee97163c1567d7407fc3bd7507a3.tar.gz latinime-b41ee671944aee97163c1567d7407fc3bd7507a3.tar.xz latinime-b41ee671944aee97163c1567d7407fc3bd7507a3.zip |
Fix the sentence separator for Hindi.
Change-Id: I623e4ccbc324751eb67ec4bb777e2be5ae2a60d1
Bug: 17418371
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java index 866f8894c..715d449a0 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java @@ -18,6 +18,8 @@ package com.android.inputmethod.latin; import android.test.suitebuilder.annotation.LargeTest; +import com.android.inputmethod.latin.settings.Settings; + @LargeTest public class InputLogicTestsNonEnglish extends InputTestsBase { final String NEXT_WORD_PREDICTION_OPTION = "next_word_prediction"; @@ -121,4 +123,32 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { assertEquals("auto-correct with umlaut for German", EXPECTED_RESULT, mEditText.getText().toString()); } + + // Corresponds to InputLogicTests#testDoubleSpace + public void testDoubleSpaceHindi() { + changeLanguage("hi"); + // Set default pref just in case + setBooleanPreference(Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, true, true); + // U+1F607 is an emoji + final String[] STRINGS_TO_TYPE = + new String[] { "this ", "a+ ", "\u1F607 ", "|| ", ") ", "( ", "% " }; + final String[] EXPECTED_RESULTS = + new String[] { "this| ", "a+| ", "\u1F607| ", "|| ", ")| ", "( ", "%| " }; + for (int i = 0; i < STRINGS_TO_TYPE.length; ++i) { + mEditText.setText(""); + type(STRINGS_TO_TYPE[i]); + assertEquals("double space processing", EXPECTED_RESULTS[i], + mEditText.getText().toString()); + } + } + + // Corresponds to InputLogicTests#testCancelDoubleSpace + public void testCancelDoubleSpaceHindi() { + changeLanguage("hi"); + final String STRING_TO_TYPE = "this "; + final String EXPECTED_RESULT = "this "; + type(STRING_TO_TYPE); + type(Constants.CODE_DELETE); + assertEquals("double space make a period", EXPECTED_RESULT, mEditText.getText().toString()); + } } |