diff --git a/beautiful-racket-demo/jsonic-demo-2/test-sources.rkt b/beautiful-racket-demo/jsonic-demo-2/test-sources.rkt index 8f8ad0b..26edbaa 100644 --- a/beautiful-racket-demo/jsonic-demo-2/test-sources.rkt +++ b/beautiful-racket-demo/jsonic-demo-2/test-sources.rkt @@ -1,11 +1,11 @@ #lang at-exp br -(require br/test rackunit) - -(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}} -]}) \ No newline at end of file +(require br/test rackunit json) + +;; 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)))))) \ No newline at end of file diff --git a/beautiful-racket-demo/jsonic-demo-3/test-sources.rkt b/beautiful-racket-demo/jsonic-demo-3/test-sources.rkt index 8f8ad0b..26edbaa 100644 --- a/beautiful-racket-demo/jsonic-demo-3/test-sources.rkt +++ b/beautiful-racket-demo/jsonic-demo-3/test-sources.rkt @@ -1,11 +1,11 @@ #lang at-exp br -(require br/test rackunit) - -(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}} -]}) \ No newline at end of file +(require br/test rackunit json) + +;; 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)))))) \ No newline at end of file diff --git a/beautiful-racket-demo/jsonic-demo/test-sources.rkt b/beautiful-racket-demo/jsonic-demo/test-sources.rkt index 8f8ad0b..26edbaa 100644 --- a/beautiful-racket-demo/jsonic-demo/test-sources.rkt +++ b/beautiful-racket-demo/jsonic-demo/test-sources.rkt @@ -1,11 +1,11 @@ #lang at-exp br -(require br/test rackunit) - -(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}} -]}) \ No newline at end of file +(require br/test rackunit json) + +;; 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)))))) \ No newline at end of file