From 20859263f2a2cf85464b333b9842bb31c020ee5e Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 15 Aug 2011 20:48:25 +0000 Subject: Removing the code which has been deprecated sin... Removing the code which has been deprecated since 2.8.0. Contributed by Simon Ochsenreither, although deleting code is such fun one hesitates to call it a contribution. Still, we will. Closes SI-4860, no review. --- test/files/run/unittest_io.scala | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'test/files/run/unittest_io.scala') diff --git a/test/files/run/unittest_io.scala b/test/files/run/unittest_io.scala index 4d2869ec3b..2cadb9b1df 100644 --- a/test/files/run/unittest_io.scala +++ b/test/files/run/unittest_io.scala @@ -6,20 +6,25 @@ object Test { } object UTF8Tests { - import io.UTF8Codec.encode + def decode(ch: Int) = new String(Array(ch), 0, 1).getBytes("UTF-8") + def run() { - assert(new String( encode(0x004D), "utf8") == new String(Array(0x004D.asInstanceOf[Char]))) - assert(new String( encode(0x0430), "utf8") == new String(Array(0x0430.asInstanceOf[Char]))) - assert(new String( encode(0x4E8C), "utf8") == new String(Array(0x4E8C.asInstanceOf[Char]))) - assert(new String(encode(0x10302), "utf8") == new String(Array(0xD800.asInstanceOf[Char], + assert(new String( decode(0x004D), "utf8") == new String(Array(0x004D.asInstanceOf[Char]))) + assert(new String( decode(0x0430), "utf8") == new String(Array(0x0430.asInstanceOf[Char]))) + assert(new String( decode(0x4E8C), "utf8") == new String(Array(0x4E8C.asInstanceOf[Char]))) + assert(new String(decode(0x10302), "utf8") == new String(Array(0xD800.asInstanceOf[Char], 0xDF02.asInstanceOf[Char]))) // a client val test = "{\"a\":\"\\u0022\"}" - val Expected = ("a","\"") - assert(scala.util.parsing.json.JSON.parse(test) match { - case Some(List(Expected)) => true - case z => Console.println(z); false - }) + val expected = "a" -> "\"" + + val parsed = scala.util.parsing.json.JSON.parseFull(test) + val result = parsed == Some(Map(expected)) + if(result) + assert(result) + else { + Console.println(parsed); assert(result) + } } } -- cgit v1.2.3