aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputLogicTests.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-03-28 13:25:04 +0900
committerJean Chalard <jchalard@google.com>2014-03-28 15:26:27 +0900
commit8e829c37dff9fb5eec62390bf0e2c6f12fd6781b (patch)
tree35712e6dc2c9178cd838a0e30c2552f4477c8d8a /tests/src/com/android/inputmethod/latin/InputLogicTests.java
parent2f781026ccfadc2ad91e5c57ff59ecb27dd192e9 (diff)
downloadlatinime-8e829c37dff9fb5eec62390bf0e2c6f12fd6781b.tar.gz
latinime-8e829c37dff9fb5eec62390bf0e2c6f12fd6781b.tar.xz
latinime-8e829c37dff9fb5eec62390bf0e2c6f12fd6781b.zip
[CB14.5] Stop copying WordComposers.
This is an overdue refactoring that I have been wanted to do forever, and that we can at last do now that suggestions come only from instances of BinaryDictionary instances. With this, all unit tests and regression tests are passing again. Bug: 13667648 Bug: 13665487 Bug: 8636060 Change-Id: Ie23a19f9b7e692edf2ee0b107ddaff2d7db564b6
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTests.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
index d4e6ad87a..b36645289 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
@@ -474,4 +474,43 @@ public class InputLogicTests extends InputTestsBase {
WORD_TO_TYPE.length() * TIMES_TO_TYPE - TIMES_TO_BACKSPACE,
mEditText.getText().length());
}
+
+ public void testManySingleQuotes() {
+ final String WORD_TO_AUTOCORRECT = "i";
+ final String WORD_AUTOCORRECTED = "I";
+ final String QUOTES = "''''''''''''''''''''";
+ final String WORD_TO_TYPE = WORD_TO_AUTOCORRECT + QUOTES + " ";
+ final String EXPECTED_RESULT = WORD_AUTOCORRECTED + QUOTES + " ";
+ type(WORD_TO_TYPE);
+ assertEquals("auto-correct with many trailing single quotes", EXPECTED_RESULT,
+ mEditText.getText().toString());
+ }
+
+ public void testManySingleQuotesOneByOne() {
+ final String WORD_TO_AUTOCORRECT = "i";
+ final String WORD_AUTOCORRECTED = "I";
+ final String QUOTES = "''''''''''''''''''''";
+ final String WORD_TO_TYPE = WORD_TO_AUTOCORRECT + QUOTES + " ";
+ final String EXPECTED_RESULT = WORD_AUTOCORRECTED + QUOTES + " ";
+
+ for (int i = 0; i < WORD_TO_TYPE.length(); ++i) {
+ type(WORD_TO_TYPE.substring(i, i+1));
+ sleep(DELAY_TO_WAIT_FOR_PREDICTIONS);
+ runMessages();
+ }
+ assertEquals("type many trailing single quotes one by one", EXPECTED_RESULT,
+ mEditText.getText().toString());
+ }
+
+ public void testTypingSingleQuotesOneByOne() {
+ final String WORD_TO_TYPE = "it's ";
+ final String EXPECTED_RESULT = WORD_TO_TYPE;
+ for (int i = 0; i < WORD_TO_TYPE.length(); ++i) {
+ type(WORD_TO_TYPE.substring(i, i+1));
+ sleep(DELAY_TO_WAIT_FOR_PREDICTIONS);
+ runMessages();
+ }
+ assertEquals("type words letter by letter", EXPECTED_RESULT,
+ mEditText.getText().toString());
+ }
}