From 8142fd83a6ed8dd6741579f724ebda9e2b70dd01 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 4 Oct 2013 21:29:20 +0900 Subject: Accept double-space-period after emoji. This also includes a fix that allows this code to read surrogate pairs in this processing. Bug: 11070482 Change-Id: If5ef8d6863938252f09128b7e99ea07ece6e7019 --- .../com/android/inputmethod/latin/InputLogicTests.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTests.java') diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index cc2569f5e..6bc8b9dd5 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -179,10 +179,17 @@ public class InputLogicTests extends InputTestsBase { } public void testDoubleSpace() { - final String STRING_TO_TYPE = "this "; - final String EXPECTED_RESULT = "this. "; - type(STRING_TO_TYPE); - assertEquals("double space make a period", EXPECTED_RESULT, mEditText.getText().toString()); + // 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()); + } } public void testCancelDoubleSpace() { -- cgit v1.2.3-83-g751a