Allow overriding how arrays are built as well
This commit is contained in:
9
test.scm
9
test.scm
@@ -116,7 +116,14 @@
|
||||
(define-test "array"
|
||||
(assert-equal '() (json "[]"))
|
||||
(assert-equal '(1 "two" #f) (json "[1, \"two\", false]"))
|
||||
(assert-equal '(() (())) (json "[[], [[]]]")))
|
||||
(assert-equal '(() (())) (json "[[], [[]]]"))
|
||||
(assert-equal "catdogsnail"
|
||||
(json "[\"cat\", \"dog\", \"snail\"]"
|
||||
#:arr-cons
|
||||
(lambda (a d)
|
||||
(if (null? d)
|
||||
a
|
||||
(string-append a d))))))
|
||||
(define-test "object"
|
||||
(assert-equal '() (json "{}"))
|
||||
(assert-equal '((cat . 1)
|
||||
|
||||
Reference in New Issue
Block a user