@@ -34,7 +34,12 @@ Describe Web.JSON
34
34
Assert Equals(JSON.decode('"\b\t\n\u000b\f\r\u000e\u000f"'), "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f")
35
35
Assert Equals(JSON.decode('"\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"'), "\x10\x11\x12\x13\x14\x15\x16\x17")
36
36
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")
38
43
End
39
44
40
45
It decodes lists
@@ -101,7 +106,10 @@ Describe Web.JSON
101
106
Assert Equals(JSON.encode("\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"), '"\b\t\n\u000b\f\r\u000e\u000f"')
102
107
Assert Equals(JSON.encode("\x10\x11\x12\x13\x14\x15\x16\x17"), '"\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"')
103
108
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\"")
105
113
End
106
114
107
115
It encodes lists
0 commit comments