summaryrefslogtreecommitdiff
path: root/test/files/run/t9915
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-09-07 22:00:14 -0700
committerSom Snytt <som.snytt@gmail.com>2016-10-20 22:13:54 -0700
commit3c5990ce5839f4bdfca8fed7f2c415a72f6a8bd8 (patch)
treef82b0265bcec314991b8c53d1ff4a9586734f7bf /test/files/run/t9915
parent9d3f0777ff883a7c59da3fa7fee156890f51701e (diff)
downloadscala-3c5990ce5839f4bdfca8fed7f2c415a72f6a8bd8.tar.gz
scala-3c5990ce5839f4bdfca8fed7f2c415a72f6a8bd8.tar.bz2
scala-3c5990ce5839f4bdfca8fed7f2c415a72f6a8bd8.zip
SI-9915 Utf8_info are modified UTF8
Use DataInputStream.readUTF to read CONSTANT_Utf8_info. This fixes reading embedded null char and supplementary chars.
Diffstat (limited to 'test/files/run/t9915')
-rw-r--r--test/files/run/t9915/C_1.java18
-rw-r--r--test/files/run/t9915/Test_2.scala12
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/run/t9915/C_1.java b/test/files/run/t9915/C_1.java
new file mode 100644
index 0000000000..cbd52606be
--- /dev/null
+++ b/test/files/run/t9915/C_1.java
@@ -0,0 +1,18 @@
+
+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/test/files/run/t9915/Test_2.scala b/test/files/run/t9915/Test_2.scala
new file mode 100644
index 0000000000..afed667cc6
--- /dev/null
+++ b/test/files/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)
+}