From 4fbf85b02f3b06882a0ec46d7fbe784d2d8ae1fb Mon Sep 17 00:00:00 2001 From: Roozbeh Pournader Date: Tue, 2 May 2017 18:33:12 -0700 Subject: [PATCH] Update unit tests for forward delete Changes in the definition of grapheme boundaries for emoji (which now relies more on what actually ligates in a font) need updating the unit tests. The changes in the unit tests are cases where the old code in Minikin assumed a single grapheme, but the new code looks in the font and finds that there are two grapheme clusters indeed. Change-Id: Icd3d2563776fb295f48e70b67a8af8e6bd3f4b38 Fixes: 37769578 Test: updated tests pass --- .../src/android/text/method/ForwardDeleteTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/tests/coretests/src/android/text/method/ForwardDeleteTest.java b/core/tests/coretests/src/android/text/method/ForwardDeleteTest.java index 839d380f79b9a..47d0ff11e311b 100644 --- a/core/tests/coretests/src/android/text/method/ForwardDeleteTest.java +++ b/core/tests/coretests/src/android/text/method/ForwardDeleteTest.java @@ -354,6 +354,8 @@ public class ForwardDeleteTest extends KeyListenerTestCase { // ZERO WIDTH JOINER + regional indicator symbol state.setByString("| U+1F469 U+200D U+1F1FA"); forwardDelete(state, 0); + state.assertEquals("| U+1F1FA"); + forwardDelete(state, 0); state.assertEquals("|"); // Regional indicator symbol + end with ZERO WIDTH JOINER @@ -364,6 +366,8 @@ public class ForwardDeleteTest extends KeyListenerTestCase { // Regional indicator symbol + ZERO WIDTH JOINER state.setByString("| U+1F1FA U+200D U+1F469"); forwardDelete(state, 0); + state.assertEquals("| U+1F469"); + forwardDelete(state, 0); state.assertEquals("|"); // Start with ZERO WIDTH JOINER + emoji modifier @@ -384,6 +388,8 @@ public class ForwardDeleteTest extends KeyListenerTestCase { // Emoji modifier + ZERO WIDTH JOINER state.setByString("| U+1F466 U+1F3FB U+200D U+1F469"); forwardDelete(state, 0); + state.assertEquals("| U+1F469"); + forwardDelete(state, 0); state.assertEquals("|"); // Regional indicator symbol + emoji modifier