Revive some test cases in BackspaceTest/ForwardDeleteTest.

Implementation can choose the support of ZWJ and Emoji modifier, so move
them back to CoreTests.

Bug: 27553165
Change-Id: Ief9ae64c8c731b927295f54d09512256449b5a88
This commit is contained in:
Seigo Nonaka
2016-03-14 14:28:38 +09:00
parent 62006a72a6
commit 328251a1d7
2 changed files with 36 additions and 0 deletions

View File

@@ -69,6 +69,10 @@ public class BackspaceTest extends KeyListenerTestCase {
public void testCombiningEnclosingKeycaps() {
EditorState state = new EditorState();
state.setByString("'1' U+E0101 U+20E3 |");
backspace(state, 0);
state.assertEquals("|");
// multiple COMBINING ENCLOSING KEYCAP
state.setByString("'1' U+20E3 U+20E3 |");
backspace(state, 0);
@@ -157,6 +161,19 @@ public class BackspaceTest extends KeyListenerTestCase {
public void testEmojiZWJSequence() {
EditorState state = new EditorState();
// U+200D is ZERO WIDTH JOINER.
state.setByString("U+1F441 U+200D U+1F5E8 |");
backspace(state, 0);
state.assertEquals("|");
state.setByString("U+1F441 U+200D U+1F5E8 U+FE0E |");
backspace(state, 0);
state.assertEquals("|");
state.setByString("U+1F468 U+200D U+2764 U+FE0F U+200D U+1F48B U+200D U+1F468 |");
backspace(state, 0);
state.assertEquals("|");
// End with ZERO WIDTH JOINER
state.setByString("U+1F441 U+200D |");
backspace(state, 0);
@@ -224,6 +241,11 @@ public class BackspaceTest extends KeyListenerTestCase {
public void testEmojiModifier() {
EditorState state = new EditorState();
// U+1F3FB is EMOJI MODIFIER FITZPATRICK TYPE-1-2.
state.setByString("U+1F466 U+1F3FB |");
backspace(state, 0);
state.assertEquals("|");
// Isolated emoji modifier
state.setByString("U+1F3FB |");
backspace(state, 0);

View File

@@ -137,6 +137,15 @@ public class ForwardDeleteTest extends KeyListenerTestCase {
public void testEmojiZeroWidthJoinerSequence() {
EditorState state = new EditorState();
// U+200D is ZERO WIDTH JOINER.
state.setByString("| U+1F441 U+200D U+1F5E8");
forwardDelete(state, 0);
state.assertEquals("|");
state.setByString("| U+1F468 U+200D U+2764 U+FE0F U+200D U+1F48B U+200D U+1F468");
forwardDelete(state, 0);
state.assertEquals("|");
// End with ZERO WIDTH JOINER
state.setByString("| U+1F441 U+200D");
forwardDelete(state, 0);
@@ -188,6 +197,11 @@ public class ForwardDeleteTest extends KeyListenerTestCase {
public void testEmojiModifier() {
EditorState state = new EditorState();
// U+1F3FB is EMOJI MODIFIER FITZPATRICK TYPE-1-2.
state.setByString("| U+1F466 U+1F3FB");
forwardDelete(state, 0);
state.assertEquals("|");
// Isolated emoji modifier
state.setByString("| U+1F3FB");
forwardDelete(state, 0);