aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-05-30 20:30:17 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-05-30 20:30:17 +0900
commit8f71fab2ed619e34222a172a5004d7f91b4520a6 (patch)
treeef95ddbd77132cfae9d2ced327f28b159005458d /tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
parentfa0e76dde606c288e4df20b779995cbce3b187fb (diff)
downloadlatinime-8f71fab2ed619e34222a172a5004d7f91b4520a6.tar.gz
latinime-8f71fab2ed619e34222a172a5004d7f91b4520a6.tar.xz
latinime-8f71fab2ed619e34222a172a5004d7f91b4520a6.zip
Make prevWord = null if the next word starts from a connector.
This fixes PunctuationTests# testAutoCorrectionWithSingleQuotesAround. Bug: 14119293 Bug: 15334309 Change-Id: I604c21a21e89a5fc431fd56ab7b6ad03f4736b01
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java b/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
index c471eca57..2c92bb3d6 100644
--- a/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
+++ b/tests/src/com/android/inputmethod/latin/RichInputConnectionAndTextRangeTests.java
@@ -187,6 +187,8 @@ public class RichInputConnectionAndTextRangeTests extends AndroidTestCase {
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
"abc def ", mSpacingAndPunctuations, 1).mPrevWord, "def");
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
+ "abc 'def", mSpacingAndPunctuations, 1).mPrevWord, "'def");
+ assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
"abc def.", mSpacingAndPunctuations, 1), PrevWordsInfo.BEGINNING_OF_SENTENCE);
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
"abc def .", mSpacingAndPunctuations, 1), PrevWordsInfo.BEGINNING_OF_SENTENCE);
@@ -196,6 +198,8 @@ public class RichInputConnectionAndTextRangeTests extends AndroidTestCase {
"abc? def", mSpacingAndPunctuations, 2), PrevWordsInfo.EMPTY_PREV_WORDS_INFO);
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
"abc! def", mSpacingAndPunctuations, 2), PrevWordsInfo.EMPTY_PREV_WORDS_INFO);
+ assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
+ "abc 'def", mSpacingAndPunctuations, 2), PrevWordsInfo.EMPTY_PREV_WORDS_INFO);
}
/**