aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t9915/Test_2.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-04-11 19:16:44 +0200
committerGuillaume Martres <smarter@ubuntu.com>2017-04-11 22:04:42 +0200
commit65f438e56b88843fd91287ca60b2e5bdd3af9cb7 (patch)
tree002004f94948186912cfb96b786b1a28a95aa2aa /tests/run/t9915/Test_2.scala
parentd313143b4b4de1e6ac0a81582fc6164609a5eae1 (diff)
downloaddotty-65f438e56b88843fd91287ca60b2e5bdd3af9cb7.tar.gz
dotty-65f438e56b88843fd91287ca60b2e5bdd3af9cb7.tar.bz2
dotty-65f438e56b88843fd91287ca60b2e5bdd3af9cb7.zip
SI-9915 Utf8_info are modified UTF8
Adapted from scalac commit 3c5990ce5839f4bdfca8fed7f2c415a72f6a8bd8 by Som Snytt: Use DataInputStream.readUTF to read CONSTANT_Utf8_info. This fixes reading embedded null char and supplementary chars.
Diffstat (limited to 'tests/run/t9915/Test_2.scala')
-rw-r--r--tests/run/t9915/Test_2.scala12
1 files changed, 12 insertions, 0 deletions
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)
+}