JSON checker

Featuring the Dragonfly web framework

JSON checker

Postby kosh » Fri Jun 28, 2013 1:03 pm

This test code is based on JSON Checker (http://www.json.org/JSON_checker/)

json-test.lsp: http://pastebin.com/9nqJHSW3

The results are here:

Code: Select all
> newlisp -v
newLISP v.10.5.2 32-bit on Win32 IPv4/6 UTF-8 libffi.

> newlisp json-test.lsp
fail1.json -> pass : "A JSON payload should be an object or array, not a string."
fail7.json -> pass : ["Comma after the close"],
fail8.json -> pass : ["Extra close"]]
fail10.json -> pass : {"Extra value after close": true} "misplaced quoted value"
fail13.json -> pass : {"Numbers cannot have leading zeroes": 013}
fail15.json -> pass : ["Illegal backslash escape: \x15"]
fail17.json -> pass : ["Illegal backslash escape: \017"]
fail18.json -> pass : [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]
fail25.json -> pass : ["   tab   character   in   string   "]
fail26.json -> pass : ["tab\   character\   in\  string\  "]
fail27.json -> pass : ["line
break"]
fail28.json -> pass : ["line\
break"]


However, this is strictly data. I think current json-parse is enough to use.

PS. A strange things, fail18.json also passes on JSONLint (http://jsonlint.com/).
kosh
 
Posts: 67
Joined: Sun Sep 13, 2009 5:38 am
Location: Japan

Return to So, what can you actually DO with newLISP?

Who is online

Users browsing this forum: No registered users and 1 guest

cron