aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java12
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTests.java6
2 files changed, 15 insertions, 3 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java
index a0ce86d1c..e090031e4 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java
@@ -288,4 +288,16 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
"abc@string/multiple_labels",
"abcabc", "def", "ghi");
}
+
+ public void testParseIndirectReference() {
+ assertTextArray("Indirect",
+ "@string/indirect_string", "a", "b", "c");
+ assertTextArray("Indirect with literal",
+ "1,@string/indirect_string_with_literal,2", "1", "x", "a", "b", "c", "y", "2");
+ }
+
+ public void testParseInfiniteIndirectReference() {
+ assertError("Infinite indirection",
+ "1,@string/infinite_indirection,2", "1", "infinite", "<infinite>", "loop", "2");
+ }
}
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
index ee3a97fab..693352c85 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
@@ -186,7 +186,7 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
}
public void testCancelDoubleSpace() {
- final String STRING_TO_TYPE = "tgis ";
+ final String STRING_TO_TYPE = "this ";
final String EXPECTED_RESULT = "this ";
type(STRING_TO_TYPE);
type(Keyboard.CODE_DELETE);
@@ -202,7 +202,7 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
mInputConnection.setSelection(NEW_CURSOR_POSITION, NEW_CURSOR_POSITION);
mLatinIME.onUpdateSelection(0, 0, NEW_CURSOR_POSITION, NEW_CURSOR_POSITION, -1, -1);
type(Keyboard.CODE_DELETE);
- assertEquals("auto correct then move curor to start of line then backspace",
+ assertEquals("auto correct then move cursor to start of line then backspace",
EXPECTED_RESULT, mTextView.getText().toString());
}
@@ -215,7 +215,7 @@ public class InputLogicTests extends ServiceTestCase<LatinIME> {
mInputConnection.setSelection(NEW_CURSOR_POSITION, NEW_CURSOR_POSITION);
mLatinIME.onUpdateSelection(0, 0, NEW_CURSOR_POSITION, NEW_CURSOR_POSITION, -1, -1);
type(Keyboard.CODE_DELETE);
- assertEquals("auto correct then move curor then backspace",
+ assertEquals("auto correct then move cursor then backspace",
EXPECTED_RESULT, mTextView.getText().toString());
}