mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
am e782f1f4
: Merge "Update RichInputConnectionAndTextRangeTests."
* commit 'e782f1f4154690da356fac6939ded66b5f66864d': Update RichInputConnectionAndTextRangeTests.
This commit is contained in:
commit
c35706af31
@ -157,10 +157,10 @@ public class RichInputConnectionAndTextRangeTests extends AndroidTestCase {
|
|||||||
// If one of the following cases breaks, the bigram suggestions won't work.
|
// If one of the following cases breaks, the bigram suggestions won't work.
|
||||||
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc def", mSpacingAndPunctuations, 2).mPrevWord, "abc");
|
"abc def", mSpacingAndPunctuations, 2).mPrevWord, "abc");
|
||||||
assertNull(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc", mSpacingAndPunctuations, 2).mPrevWord);
|
"abc", mSpacingAndPunctuations, 2), PrevWordsInfo.BEGINNING_OF_SENTENCE);
|
||||||
assertNull(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc. def", mSpacingAndPunctuations, 2).mPrevWord);
|
"abc. def", mSpacingAndPunctuations, 2), PrevWordsInfo.BEGINNING_OF_SENTENCE);
|
||||||
|
|
||||||
assertFalse(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertFalse(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc def", mSpacingAndPunctuations, 2).mIsBeginningOfSentence);
|
"abc def", mSpacingAndPunctuations, 2).mIsBeginningOfSentence);
|
||||||
@ -180,16 +180,22 @@ public class RichInputConnectionAndTextRangeTests extends AndroidTestCase {
|
|||||||
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc def .", mSpacingAndPunctuations, 2).mPrevWord, "def");
|
"abc def .", mSpacingAndPunctuations, 2).mPrevWord, "def");
|
||||||
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc ", mSpacingAndPunctuations, 2).mPrevWord, null);
|
"abc ", mSpacingAndPunctuations, 2), PrevWordsInfo.BEGINNING_OF_SENTENCE);
|
||||||
|
|
||||||
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc def", mSpacingAndPunctuations, 1).mPrevWord, "def");
|
"abc def", mSpacingAndPunctuations, 1).mPrevWord, "def");
|
||||||
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc def ", mSpacingAndPunctuations, 1).mPrevWord, "def");
|
"abc def ", mSpacingAndPunctuations, 1).mPrevWord, "def");
|
||||||
assertNull(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc def.", mSpacingAndPunctuations, 1).mPrevWord);
|
"abc def.", mSpacingAndPunctuations, 1), PrevWordsInfo.BEGINNING_OF_SENTENCE);
|
||||||
assertNull(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
"abc def .", mSpacingAndPunctuations, 1).mPrevWord);
|
"abc def .", mSpacingAndPunctuations, 1), PrevWordsInfo.BEGINNING_OF_SENTENCE);
|
||||||
|
assertEquals(RichInputConnection.getPrevWordsInfoFromNthPreviousWord(
|
||||||
|
"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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user