assertFalse(Bidi.requiresBidi("aa\u05D0a".toCharArray(), 0, 2));
assertTrue(Bidi.requiresBidi("aa\u05D0a".toCharArray(), 1, 3));
}
public void testHebrewOverrideEmbeddings() {
bd = new Bidi(new char[] { '\u05D0', '\u05D0', '\u05D0' }, 0,
new byte[] { (byte) -1, (byte) -2, (byte) -3 }, 0, 3,
Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
assertFalse(bd.baseIsLeftToRight());
assertEquals(1, bd.getBaseLevel());
assertEquals(3, bd.getLength());
assertEquals(1, bd.getLevelAt(0));
assertEquals(2, bd.getLevelAt(1));
assertEquals(3, bd.getLevelAt(2));
assertEquals(1, bd.getLevelAt(1000));
assertEquals(3, bd.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 1, 1 }, { 1, 2, 2 },
{ 2, 3, 3 }, }, bd);
assertFalse(bd.isLeftToRight());
assertTrue(bd.isMixed());
assertFalse(bd.isRightToLeft());
bd = new Bidi(new char[] { '\u05D0', '\u05D0', '\u05D0' }, 0,
new byte[] { (byte) -1, (byte) -2, (byte) -3 }, 0, 3,
Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT);
assertFalse(bd.baseIsLeftToRight());
assertEquals(1, bd.getBaseLevel());
assertEquals(3, bd.getLength());
assertEquals(1, bd.getLevelAt(0));
assertEquals(2, bd.getLevelAt(1));
assertEquals(3, bd.getLevelAt(2));
assertEquals(1, bd.getLevelAt(1000));
assertEquals(3, bd.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 1, 1 }, { 1, 2, 2 },
{ 2, 3, 3 }, }, bd);
assertFalse(bd.isLeftToRight());
assertTrue(bd.isMixed());
assertFalse(bd.isRightToLeft());
bd = new Bidi(new char[] { '\u05D0', '\u05D0', '\u05D0' }, 0,
new byte[] { (byte) -1, (byte) -2, (byte) -3 }, 0, 3,
Bidi.DIRECTION_LEFT_TO_RIGHT);
assertTrue(bd.baseIsLeftToRight());
assertEquals(0, bd.getBaseLevel());
assertEquals(3, bd.getLength());
assertEquals(1, bd.getLevelAt(0));
assertEquals(2, bd.getLevelAt(1));
assertEquals(3, bd.getLevelAt(2));
assertEquals(0, bd.getLevelAt(1000));
assertEquals(3, bd.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 1, 1 }, { 1, 2, 2 },
{ 2, 3, 3 }, }, bd);
assertFalse(bd.isLeftToRight());
assertTrue(bd.isMixed());
assertFalse(bd.isRightToLeft());
bd = new Bidi(new char[] { '\u05D0', '\u05D0', '\u05D0' }, 0,
new byte[] { (byte) -1, (byte) -2, (byte) -3 }, 0, 3,
Bidi.DIRECTION_RIGHT_TO_LEFT);
assertFalse(bd.baseIsLeftToRight());
assertEquals(1, bd.getBaseLevel());
assertEquals(3, bd.getLength());