--- /dev/null
+/*
+Copyright (c) 2005 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
--- /dev/null
+The .json files in this directory are taken from the JSON_checker
+project [1], and are covered by the license in LICENSE.txt.
+
+[1] http://www.json.org/JSON_checker/
--- /dev/null
+"A JSON payload should be an object or array, not a string."
\ No newline at end of file
--- /dev/null
+{"Extra value after close": true} "misplaced quoted value"
\ No newline at end of file
--- /dev/null
+{"Illegal expression": 1 + 2}
\ No newline at end of file
--- /dev/null
+{"Illegal invocation": alert()}
\ No newline at end of file
--- /dev/null
+{"Numbers cannot have leading zeroes": 013}
\ No newline at end of file
--- /dev/null
+{"Numbers cannot be hex": 0x14}
\ No newline at end of file
--- /dev/null
+["Illegal backslash escape: \x15"]
\ No newline at end of file
--- /dev/null
+[\naked]
\ No newline at end of file
--- /dev/null
+["Illegal backslash escape: \017"]
\ No newline at end of file
--- /dev/null
+[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]
\ No newline at end of file
--- /dev/null
+{"Missing colon" null}
\ No newline at end of file
--- /dev/null
+["Unclosed array"
\ No newline at end of file
--- /dev/null
+{"Double colon":: null}
\ No newline at end of file
--- /dev/null
+{"Comma instead of colon", null}
\ No newline at end of file
--- /dev/null
+["Colon instead of comma": false]
\ No newline at end of file
--- /dev/null
+["Bad value", truth]
\ No newline at end of file
--- /dev/null
+['single quote']
\ No newline at end of file
--- /dev/null
+[" tab character in string "]
\ No newline at end of file
--- /dev/null
+["tab\ character\ in\ string\ "]
\ No newline at end of file
--- /dev/null
+["line
+break"]
\ No newline at end of file
--- /dev/null
+["line\
+break"]
\ No newline at end of file
--- /dev/null
+[0e]
\ No newline at end of file
--- /dev/null
+{unquoted_key: "keys must be quoted"}
\ No newline at end of file
--- /dev/null
+[0e+]
\ No newline at end of file
--- /dev/null
+[0e+-1]
\ No newline at end of file
--- /dev/null
+{"Comma instead if closing brace": true,
\ No newline at end of file
--- /dev/null
+["mismatch"}
\ No newline at end of file
--- /dev/null
+["extra comma",]
\ No newline at end of file
--- /dev/null
+["double extra comma",,]
\ No newline at end of file
--- /dev/null
+[ , "<-- missing value"]
\ No newline at end of file
--- /dev/null
+["Comma after the close"],
\ No newline at end of file
--- /dev/null
+["Extra close"]]
\ No newline at end of file
--- /dev/null
+{"Extra comma": true,}
\ No newline at end of file
--- /dev/null
+[
+ "JSON Test Pattern pass1",
+ {"object with 1 member":["array with 1 element"]},
+ {},
+ [],
+ -42,
+ true,
+ false,
+ null,
+ {
+ "integer": 1234567890,
+ "real": -9876.543210,
+ "e": 0.123456789e-12,
+ "E": 1.234567890E+34,
+ "": 23456789012E66,
+ "zero": 0,
+ "one": 1,
+ "space": " ",
+ "quote": "\"",
+ "backslash": "\\",
+ "controls": "\b\f\n\r\t",
+ "slash": "/ & \/",
+ "alpha": "abcdefghijklmnopqrstuvwyz",
+ "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
+ "digit": "0123456789",
+ "0123456789": "digit",
+ "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
+ "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
+ "true": true,
+ "false": false,
+ "null": null,
+ "array":[ ],
+ "object":{ },
+ "address": "50 St. James Street",
+ "url": "http://www.JSON.org/",
+ "comment": "// /* <!-- --",
+ "# -- --> */": " ",
+ " s p a c e d " :[1,2 , 3
+
+,
+
+4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
+ "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
+ "quotes": "" \u0022 %22 0x22 034 "",
+ "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
+: "A key can be any string"
+ },
+ 0.5 ,98.6
+,
+99.44
+,
+
+1066,
+1e1,
+0.1e1,
+1e-1,
+1e00,2e+00,2e-00
+,"rosebud"]
\ No newline at end of file
--- /dev/null
+[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
\ No newline at end of file
--- /dev/null
+{
+ "JSON Test Pattern pass3": {
+ "The outermost value": "must be an object or array.",
+ "In this test": "It is an object."
+ }
+}
--- /dev/null
+#!/bin/bash
+
+PROG=../json_test
+
+for f in `ls *pass*.json`; do
+ $PROG $f > /dev/null 2>&1
+ if [ $? -ne 0 ] ; then
+ echo Test case $f should pass, but failed.
+ fi
+done
+for f in `ls *fail*.json`; do
+ $PROG $f > /dev/null 2>&1
+ if [ $? -eq 0 ] ; then
+ echo Test case $f should fail, but passed.
+ fi
+done