-USING: arrays json.reader kernel strings tools.test
-hashtables json ;
+USING: assocs arrays json.reader kernel strings tools.test
+hashtables json io.streams.string ;
IN: json.reader.tests
{ f } [ "false" json> ] unit-test
! unicode is allowed in json
{ "ß∂¬ƒ˚∆" } [ """ "ß∂¬ƒ˚∆"""" json> ] unit-test
{ 8 9 10 12 13 34 47 92 } >string 1array [ """ "\\b\\t\\n\\f\\r\\"\\/\\\\" """ json> ] unit-test
-{ HEX: abcd } >string 1array [ """ "\\uaBCd" """ json> ] unit-test
+{ 0xabcd } >string 1array [ """ "\\uaBCd" """ json> ] unit-test
{ H{ { "a" { } } { "b" 123 } } } [ "{\"a\":[],\"b\":123}" json> ] unit-test
{ { } } [ "[]" json> ] unit-test
{ 0 } [ " 0" json> ] unit-test
{ 0 } [ "0 " json> ] unit-test
{ 0 } [ " 0 " json> ] unit-test
+
+{ V{ H{ { "a" "b" } } H{ { "c" "d" } } } }
+[ """{"a": "b"} {"c": "d"}""" [ read-jsons ] with-string-reader ] unit-test
+
+! empty objects are allowed as values in objects
+{ H{ { "foo" H{ } } } } [ "{ \"foo\" : {}}" json> ] unit-test