test JSON using jsexpr

v6.3-exception
Matthew Butterick 6 years ago
parent 3cf4fe260e
commit 6b9dd5a011

@ -1,11 +1,11 @@
#lang at-exp br #lang at-exp br
(require br/test rackunit) (require br/test rackunit json)
(check-equal? (run-source "jsonic-test.rkt") @string-append{ ;; don't compare string output directly because
[ ;; hash element isn't converted in a reliable order
null, (check-equal? (string->jsexpr (run-source "jsonic-test.rkt"))
42, '(null
true, 42
["array","of","strings"], #t
{"key-2":false,"key-1":null,"key-3":{"subkey":21}} ("array" "of" "strings")
]}) #hasheq((key-1 . null) (key-2 . #f) (key-3 . #hasheq((subkey . 21))))))

@ -1,11 +1,11 @@
#lang at-exp br #lang at-exp br
(require br/test rackunit) (require br/test rackunit json)
(check-equal? (run-source "jsonic-test.rkt") @string-append{ ;; don't compare string output directly because
[ ;; hash element isn't converted in a reliable order
null, (check-equal? (string->jsexpr (run-source "jsonic-test.rkt"))
42, '(null
true, 42
["array","of","strings"], #t
{"key-2":false,"key-1":null,"key-3":{"subkey":21}} ("array" "of" "strings")
]}) #hasheq((key-1 . null) (key-2 . #f) (key-3 . #hasheq((subkey . 21))))))

@ -1,11 +1,11 @@
#lang at-exp br #lang at-exp br
(require br/test rackunit) (require br/test rackunit json)
(check-equal? (run-source "jsonic-test.rkt") @string-append{ ;; don't compare string output directly because
[ ;; hash element isn't converted in a reliable order
null, (check-equal? (string->jsexpr (run-source "jsonic-test.rkt"))
42, '(null
true, 42
["array","of","strings"], #t
{"key-2":false,"key-1":null,"key-3":{"subkey":21}} ("array" "of" "strings")
]}) #hasheq((key-1 . null) (key-2 . #f) (key-3 . #hasheq((subkey . 21))))))
Loading…
Cancel
Save