aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t9915
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/t9915')
-rw-r--r--tests/run/t9915/C_1.java20
-rw-r--r--tests/run/t9915/Test_2.scala12
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/run/t9915/C_1.java b/tests/run/t9915/C_1.java
new file mode 100644
index 000000000..4269cf74e
--- /dev/null
+++ b/tests/run/t9915/C_1.java
@@ -0,0 +1,20 @@
+/*
+ * javac: -encoding UTF-8
+ */
+public class C_1 {
+ public static final String NULLED = "X\000ABC";
+ public static final String SUPPED = "𐒈𐒝𐒑𐒛𐒐𐒘𐒕𐒖";
+
+ public String nulled() {
+ return C_1.NULLED;
+ }
+ public String supped() {
+ return C_1.SUPPED;
+ }
+ public int nulledSize() {
+ return C_1.NULLED.length();
+ }
+ public int suppedSize() {
+ return C_1.SUPPED.length();
+ }
+}
diff --git a/tests/run/t9915/Test_2.scala b/tests/run/t9915/Test_2.scala
new file mode 100644
index 000000000..afed667cc
--- /dev/null
+++ b/tests/run/t9915/Test_2.scala
@@ -0,0 +1,12 @@
+
+object Test extends App {
+ val c = new C_1
+ assert(c.nulled == "X\u0000ABC") // "X\000ABC"
+ assert(c.supped == "𐒈𐒝𐒑𐒛𐒐𐒘𐒕𐒖")
+
+ assert(C_1.NULLED == "X\u0000ABC") // "X\000ABC"
+ assert(C_1.SUPPED == "𐒈𐒝𐒑𐒛𐒐𐒘𐒕𐒖")
+
+ assert(C_1.NULLED.size == "XYABC".size)
+ assert(C_1.SUPPED.codePointCount(0, C_1.SUPPED.length) == 8)
+}