summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/010/json.tl29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/010/json.tl b/tests/010/json.tl
index b7117d8a..57c9a8c5 100644
--- a/tests/010/json.tl
+++ b/tests/010/json.tl
@@ -207,3 +207,32 @@
(get-json "0") 0.0
(get-json "12345") 12345.0
(get-json "12345678900000000000000000") 1.23456789E25)
+
+(let ((obj #H(() ("a" #(1 2 3))
+ ("b" #H(() ("c" "d")
+ ("e" t) ("f" nil) ("g" #(4 5 6)))))))
+ (mtest
+ (tojson obj) "{\"a\":[1,2,3],\"b\":{\"c\":\"d\",\"f\":false,\"g\":[4,5,6],\"e\":true}}"
+ (tojson obj t) "{\"a\":[1,2,3],\"b\":{\"c\":\"d\",\"f\":false,\"g\":[4,5,6],\"e\":true}}"
+ (let ((*print-json-format* :standard))
+ (tojson obj))
+ "{\n \
+ \ \"a\" : [\n\
+ \ 1,\n\
+ \ 2,\n\
+ \ 3\n\
+ \ ],\n\
+ \ \"b\" : {\n\
+ \ \"c\" : \"d\",\n\
+ \ \"f\" : false,\n\
+ \ \"g\" : [\n\
+ \ 4,\n\
+ \ 5,\n\
+ \ 6\n\
+ \ ],\n\
+ \ \"e\" : true\n\
+ \ }\n\
+ }"
+ (let ((*print-json-format* :standard))
+ (tojson obj t))
+ "{\"a\":[1,2,3],\"b\":{\"c\":\"d\",\"f\":false,\"g\":[4,5,6],\"e\":true}}"))