From 1e71c9d5935b12cbd3a407100da3a40c8f59804a Mon Sep 17 00:00:00 2001 From: "andrew.lai" Date: Fri, 25 Sep 2020 17:57:17 +0800 Subject: [PATCH] added unicode parse test --- src/test/scala/io/github/shopee/idata/sjson/ParseTest.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/scala/io/github/shopee/idata/sjson/ParseTest.scala b/src/test/scala/io/github/shopee/idata/sjson/ParseTest.scala index b036850..0a05f3f 100644 --- a/src/test/scala/io/github/shopee/idata/sjson/ParseTest.scala +++ b/src/test/scala/io/github/shopee/idata/sjson/ParseTest.scala @@ -12,6 +12,12 @@ class ParseTest extends org.scalatest.FunSuite { assert(JSON.parse(JSON.stringify(v)) == v) } + test("parse: map unicode") { + val input = "[{\"\\u\":\"\\u\"}]" + val output = JSON.parse(input).asInstanceOf[List[Map[String, String]]](0)("u") + assert(output == "\\u") + } + test("parse: true|false|null") { List[Any](true, false, null).map(testParseSym) assert(JSON.parse(JSON.stringify(None)) == null)