Skip to content

Commit ba12215

Browse files
committed
Add regression test for bug of char to string conversion
After converting '\uFFFF' to string the result differs from "\uFFFF" for a check with `equals()`.
1 parent 754ebdb commit ba12215

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
public class Test {
2+
public void test1() {
3+
char c = '\uFFFF';
4+
String s = String.valueOf(c);
5+
assert s.equals("\uFFFF");
6+
}
7+
8+
public void test2() {
9+
char c = '\uFFFE';
10+
String s = String.valueOf(c);
11+
assert s.equals("\uFFFE");
12+
}
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
KNOWNBUG
2+
Test.class
3+
--function Test.test1 --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CORE
2+
Test.class
3+
--function Test.test2 --cp `../../../../scripts/format_classpath.sh . ../../../lib/java-models-library/target/core-models.jar`
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$

0 commit comments

Comments
 (0)