diff options
author | 2012-02-07 22:48:16 -0800 | |
---|---|---|
committer | 2012-02-07 22:48:16 -0800 | |
commit | 4df3dc98d4811c23f32d944123d25a42069b9c8c (patch) | |
tree | 06ef91761c5496ea3529bcc2cb9536f7b02223fe /tests/src/com/android/inputmethod/latin/InputLogicTests.java | |
parent | 5a57a8f52e7730d860e3c5471ec65941bb87dfe3 (diff) | |
parent | 1bd1cd19c0bf1367a0355b1f46caa9979e976aca (diff) | |
download | latinime-4df3dc98d4811c23f32d944123d25a42069b9c8c.tar.gz latinime-4df3dc98d4811c23f32d944123d25a42069b9c8c.tar.xz latinime-4df3dc98d4811c23f32d944123d25a42069b9c8c.zip |
am 1bd1cd19: Merge "Fix the auto-composer to support supplementary chars"
* commit '1bd1cd19c0bf1367a0355b1f46caa9979e976aca':
Fix the auto-composer to support supplementary chars
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputLogicTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputLogicTests.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index 2cecc9d8d..9d886da3b 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -159,11 +159,26 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> { } public void testPickSuggestionThenBackspace() { - final String WORD_TO_TYPE = "tgis"; + final String WORD_TO_TYPE = "this"; + final String EXPECTED_RESULT = "this"; type(WORD_TO_TYPE); mLatinIME.pickSuggestionManually(0, WORD_TO_TYPE); + mLatinIME.onUpdateSelection(0, 0, WORD_TO_TYPE.length(), WORD_TO_TYPE.length(), -1, -1); type(Keyboard.CODE_DELETE); - assertEquals("press suggestion then backspace", WORD_TO_TYPE, + assertEquals("press suggestion then backspace", EXPECTED_RESULT, + mTextView.getText().toString()); + } + + public void testPickTypedWordOverAutoCorrectionThenBackspace() { + final String WORD_TO_TYPE = "tgis"; + final String EXPECTED_RESULT = "tgis"; + type(WORD_TO_TYPE); + // Choose the typed word, which should be in position 1 (because position 0 should + // be occupied by the "this" auto-correction, as checked by testAutoCorrect()) + mLatinIME.pickSuggestionManually(1, WORD_TO_TYPE); + mLatinIME.onUpdateSelection(0, 0, WORD_TO_TYPE.length(), WORD_TO_TYPE.length(), -1, -1); + type(Keyboard.CODE_DELETE); + assertEquals("pick typed word over auto-correction then backspace", EXPECTED_RESULT, mTextView.getText().toString()); } @@ -379,4 +394,6 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> { assertEquals("type word type dot then press the .com key", EXPECTED_RESULT, mTextView.getText().toString()); } + + // TODO: Add some tests for non-BMP characters } |