Merge "Add tests for double space behavior"

main
Jean Chalard 2012-01-25 22:09:40 -08:00 committed by Android (Google) Code Review
commit 20ec43a265
1 changed files with 15 additions and 0 deletions

View File

@ -177,4 +177,19 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
type(STRING_TO_TYPE); type(STRING_TO_TYPE);
assertEquals("simple auto-correct", EXPECTED_RESULT, mTextView.getText().toString()); assertEquals("simple auto-correct", EXPECTED_RESULT, mTextView.getText().toString());
} }
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, mTextView.getText().toString());
}
public void testCancelDoubleSpace() {
final String STRING_TO_TYPE = "tgis ";
final String EXPECTED_RESULT = "this ";
type(STRING_TO_TYPE);
type(Keyboard.CODE_DELETE);
assertEquals("double space make a period", EXPECTED_RESULT, mTextView.getText().toString());
}
} }