diff options
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTests.java | 12 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index d2dd29262..29423e8e3 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -334,6 +334,18 @@ public class InputLogicTests extends InputTestsBase { assertEquals("manual pick then separator", EXPECTED_RESULT, mEditText.getText().toString()); } + // This test matches the one in InputLogicTestsNonEnglish. In some non-English languages, + // ! and ? are clustering punctuation signs. + public void testClusteringPunctuation() { + final String WORD1_TO_TYPE = "test"; + final String WORD2_TO_TYPE = "!!?!:!"; + final String EXPECTED_RESULT = "test!!?!:!"; + type(WORD1_TO_TYPE); + pickSuggestionManually(0, WORD1_TO_TYPE); + type(WORD2_TO_TYPE); + assertEquals("clustering punctuation", EXPECTED_RESULT, mEditText.getText().toString()); + } + public void testManualPickThenStripperThenPick() { final String WORD_TO_TYPE = "this"; final String STRIPPER = "\n"; diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java index 1257ae297..68b6ee674 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java @@ -45,6 +45,19 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { mEditText.getText().toString()); } + public void testClusteringPunctuationForFrench() { + final String WORD1_TO_TYPE = "test"; + final String WORD2_TO_TYPE = "!!?!:!"; + // In English, the expected result would be "test!!?!:!" + final String EXPECTED_RESULT = "test !!?! : !"; + changeLanguage("fr"); + type(WORD1_TO_TYPE); + pickSuggestionManually(0, WORD1_TO_TYPE); + type(WORD2_TO_TYPE); + assertEquals("clustering punctuation for French", EXPECTED_RESULT, + mEditText.getText().toString()); + } + public void testWordThenSpaceThenPunctuationFromStripTwiceForFrench() { final String WORD_TO_TYPE = "test "; final String PUNCTUATION_FROM_STRIP = "!"; |