Skip to content

Commit

Permalink
Merge "Add regression test for Unicode 9 Bidi data." into nyc-mr1-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Sauer authored and Android (Google) Code Review committed Sep 15, 2016
2 parents f8e5fce + 29c20ed commit 1d6b30a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions luni/src/test/java/libcore/java/text/OldBidiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package libcore.java.text;

import java.text.AttributedCharacterIterator;
import java.text.Bidi;
import junit.framework.TestCase;

Expand Down Expand Up @@ -192,4 +193,16 @@ public void testConstructorIllegalArguments() {
}
}

// http://b/30652865
public void testUnicode9EmojisAreLtrNeutral() {
String callMeHand = "\uD83E\uDD19"; // U+1F919 in UTF-16
String hebrewAndEmoji = "\u05e9\u05dc" + callMeHand + "\u05d5\u05dd";
String latinAndEmoji = "Hel" + callMeHand + "lo";
Bidi hebrew = new Bidi(hebrewAndEmoji, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
assertFalse("Hebrew bidi is mixed: " + hebrew, hebrew.isMixed());
assertTrue("Hebrew bidi is not right to left: " + hebrew, hebrew.isRightToLeft());
Bidi latin = new Bidi(latinAndEmoji, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
assertFalse("Latin bidi is mixed: " + latin, latin.isMixed());
assertTrue("latin bidi is not left to right: " + latin, latin.isLeftToRight());
}
}

0 comments on commit 1d6b30a

Please sign in to comment.