Skip to content

Commit

Permalink
Unbreak json tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
samth committed Jun 14, 2013
1 parent 95aed53 commit 9b29dcb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions collects/json/main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
(provide string->jsexpr bytes->jsexpr)
(define (string->jsexpr str #:null [jsnull (json-null)])
(unless (string? str) (raise-type-error 'string->jsexpr "string" str))
(read-json (open-input-string str) #:null jsnull #:function string->jsexpr))
(read-json (open-input-string str) #:null jsnull #:function 'string->jsexpr))
(define (bytes->jsexpr str #:null [jsnull (json-null)])
(unless (bytes? str) (raise-type-error 'bytes->jsexpr "bytes" str))
(read-json (open-input-bytes str) #:null jsnull #:function bytes->jsexpr))
(read-json (open-input-bytes str) #:null jsnull #:function 'bytes->jsexpr))
32 changes: 16 additions & 16 deletions collects/json/tests/json.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
@T{ 1 [2,3] "four" }))])
je)
=> '(1 (2 3) "four")
(string->jsexpr "]") =error> "read-json:"
(string->jsexpr "foo") =error> "read-json:"
(string->jsexpr "]") =error> "string->jsexpr:"
(string->jsexpr "foo") =error> "string->jsexpr:"
(string->jsexpr "") => eof
(string->jsexpr " \t\r\n") => eof

Expand All @@ -117,20 +117,20 @@
(string->jsexpr @T{ "/" }) => "/"
(string->jsexpr @T{ "\/" }) => "/"
;; More error tests:
(string->jsexpr @T{ [1,2,,3] }) =error> "read-json:"
(string->jsexpr @T{ [1,2,3,] }) =error> "read-json:"
(string->jsexpr @T{ {42 : "bad-key!"} }) =error> "read-json:"
(string->jsexpr @T{ {'no-colon' , ""} }) =error> "read-json:"
(string->jsexpr @T{ {"x":1,,"y":2} }) =error> "read-json:"
(string->jsexpr @T{ {x:1, y:2} }) =error> "read-json:"
(string->jsexpr " {x:1, y:2] ") =error> "read-json:"
(string->jsexpr " [\"x\",1, \"y\",2} ") =error> "read-json:"
(string->jsexpr @T{ truelove }) =error> "read-json:"
(string->jsexpr @T{ truebred }) =error> "read-json:"
(string->jsexpr @T{ falsehood }) =error> "read-json:"
(string->jsexpr @T{ falsetto }) =error> "read-json:"
(string->jsexpr @T{ nullity }) =error> "read-json:"
(string->jsexpr @T{ nulliparous }) =error> "read-json:"
(string->jsexpr @T{ [1,2,,3] }) =error> "string->jsexpr:"
(string->jsexpr @T{ [1,2,3,] }) =error> "string->jsexpr:"
(string->jsexpr @T{ {42 : "bad-key!"} }) =error> "string->jsexpr:"
(string->jsexpr @T{ {'no-colon' , ""} }) =error> "string->jsexpr:"
(string->jsexpr @T{ {"x":1,,"y":2} }) =error> "string->jsexpr:"
(string->jsexpr @T{ {x:1, y:2} }) =error> "string->jsexpr:"
(string->jsexpr " {x:1, y:2] ") =error> "string->jsexpr:"
(string->jsexpr " [\"x\",1, \"y\",2} ") =error> "string->jsexpr:"
(string->jsexpr @T{ truelove }) =error> "string->jsexpr:"
(string->jsexpr @T{ truebred }) =error> "string->jsexpr:"
(string->jsexpr @T{ falsehood }) =error> "string->jsexpr:"
(string->jsexpr @T{ falsetto }) =error> "string->jsexpr:"
(string->jsexpr @T{ nullity }) =error> "string->jsexpr:"
(string->jsexpr @T{ nulliparous }) =error> "string->jsexpr:"
))

(test do (pred-tests)
Expand Down

0 comments on commit 9b29dcb

Please sign in to comment.