test JSON using jsexpr

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

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

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

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