mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-24 13:51:12 +00:00
Split testcases for StringBuilder.codePointCount
This commit is contained in:
parent
e4e1bb6949
commit
cabb3efeac
@ -215,13 +215,13 @@ public class Supplementary {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test codePointCount(int, int) & codePointCount()
|
||||
* Test codePointCount(int, int)
|
||||
*
|
||||
* This test case assumes that
|
||||
* Character.codePointCount(CharSequence, int, int) works
|
||||
* correctly.
|
||||
*/
|
||||
static void test5() {
|
||||
static void testCodePointCountTwoArgs() {
|
||||
for (int i = 0; i < input.length; i++) {
|
||||
String s = input[i];
|
||||
StringBuilder sb = new StringBuilder(s);
|
||||
@ -239,11 +239,6 @@ public class Supplementary {
|
||||
result, expected);
|
||||
}
|
||||
|
||||
|
||||
int result = sb.codePointCount();
|
||||
int expected = Character.codePointCount(sb, 0, sb.length());
|
||||
check(result != expected, "codePointCount()", result, expected);
|
||||
|
||||
// test exceptions
|
||||
testCodePointCount(null, 0, 0, NullPointerException.class);
|
||||
testCodePointCount(sb, -1, length, IndexOutOfBoundsException.class);
|
||||
@ -252,6 +247,24 @@ public class Supplementary {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test codePointCount()
|
||||
*
|
||||
* This test case assumes that
|
||||
* Character.codePointCount(CharSequence) works
|
||||
* correctly.
|
||||
*/
|
||||
static void testCodePointCountNoArg() {
|
||||
for (int i = 0; i < input.length; i++) {
|
||||
String s = input[i];
|
||||
StringBuilder sb = new StringBuilder(s);
|
||||
|
||||
int result = sb.codePointCount();
|
||||
int expected = Character.codePointCount(sb, 0, sb.length());
|
||||
check(result != expected, "codePointCount()", result, expected)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test offsetByCodePoints(int, int)
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user