LANG-1300: Updated StringUtilsEqualsIndexOfTest to account for new changes

This commit is contained in:
MarkDacek 2017-03-06 21:54:40 -05:00
parent a8f41ec97d
commit 0181c8059c
1 changed files with 23 additions and 0 deletions

View File

@ -294,6 +294,18 @@ public class StringUtilsEqualsIndexOfTest {
assertEquals(2, StringUtils.indexOf("aabaabaa", 'b', -1));
assertEquals(5, StringUtils.indexOf(new StringBuilder("aabaabaa"), 'b', 3));
//LANG-1300 tests go here
final int CODE_POINT = 0x2070E;
StringBuilder builder = new StringBuilder();
builder.appendCodePoint(CODE_POINT);
assertEquals(0, StringUtils.indexOf(builder, CODE_POINT, 0));
//inner branch on the supplementary character block
char[] tmp = {(char) 55361};
builder = new StringBuilder();
builder.append(tmp);
assertEquals(-1, StringUtils.indexOf(builder, CODE_POINT, 0));
}
@Test
@ -525,6 +537,17 @@ public class StringUtilsEqualsIndexOfTest {
assertEquals(0, StringUtils.lastIndexOf("aabaabaa", 'a', 0));
assertEquals(2, StringUtils.lastIndexOf(new StringBuilder("aabaabaa"), 'b', 2));
//LANG-1300 addition test
final int CODE_POINT = 0x2070E;
StringBuilder builder = new StringBuilder();
builder.appendCodePoint(CODE_POINT);
assertEquals(0, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
//inner branch on the supplementary character block
char[] tmp = {(char) 55361};
builder = new StringBuilder();
builder.append(tmp);
assertEquals(-1, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
}
@Test