@@ -34,7 +34,12 @@ Describe Web.JSON
3434 Assert Equals(JSON.decode('"\b\t\n\u000b\f\r\u000e\u000f"'), "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f")
3535 Assert Equals(JSON.decode('"\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"'), "\x10\x11\x12\x13\x14\x15\x16\x17")
3636 Assert Equals(JSON.decode('"\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f"'), "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f")
37- " there should be iconv tests as well
37+ " multibyte
38+ Assert Equals(JSON.decode('"s¢cĴgё"'), "s¢cĴgё")
39+ " UTF-16 surrogate pair
40+ Assert Equals(JSON.decode('"\ud83c\udf63"'), "\xf0\x9f\x8d\xa3")
41+ " unpaired UTF-16 surrogate
42+ Assert Equals(JSON.decode('"\ud83c\u00a0"'), "\ud83c\u00a0")
3843 End
3944
4045 It decodes lists
@@ -101,7 +106,10 @@ Describe Web.JSON
101106 Assert Equals(JSON.encode("\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"), '"\b\t\n\u000b\f\r\u000e\u000f"')
102107 Assert Equals(JSON.encode("\x10\x11\x12\x13\x14\x15\x16\x17"), '"\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"')
103108 Assert Equals(JSON.encode("\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"), '"\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f"')
104- " there should be iconv tests as well
109+ " multibyte
110+ Assert Equals(JSON.encode("s¢cĴgё"), '"s¢cĴgё"')
111+ " UTF-16 surrogate pair
112+ Assert Equals(JSON.encode("\xf0\x9f\x8d\xa3"), "\"\xf0\x9f\x8d\xa3\"")
105113 End
106114
107115 It encodes lists
0 commit comments