From 60e7718462a8c7b025ac8375b585c1da3db1e1fe Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 26 Jan 2012 10:10:38 +0900 Subject: [PATCH] Add tests for double space behavior Bug: 5875776 Change-Id: Icc28b6c5c0132a3afc8d603841c9e321f720b7c9 --- .../inputmethod/latin/InputLogicTests.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index 59ca22df4..7b87be6d3 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -177,4 +177,19 @@ public class InputLogicTests extends ServiceTestCase { type(STRING_TO_TYPE); 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()); + } }