michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: testJSON('[', true); michael@0: testJSON('[1', true); michael@0: testJSON('[1,]', true); michael@0: testJSON('[1,{', true); michael@0: testJSON('[1,}', true); michael@0: testJSON('[1,{]', true); michael@0: testJSON('[1,}]', true); michael@0: testJSON('[1,{"', true); michael@0: testJSON('[1,}"', true); michael@0: testJSON('[1,{"\\', true); michael@0: testJSON('[1,}"\\', true); michael@0: testJSON('[1,"', true); michael@0: testJSON('[1,"\\', true); michael@0: michael@0: testJSON('{', true); michael@0: testJSON('{1', true); michael@0: testJSON('{,', true); michael@0: testJSON('{"', true); michael@0: testJSON('{"\\', true); michael@0: testJSON('{"\\u', true); michael@0: testJSON('{"\\uG', true); michael@0: testJSON('{"\\u0', true); michael@0: testJSON('{"\\u01', true); michael@0: testJSON('{"\\u012', true); michael@0: testJSON('{"\\u0123', true); michael@0: testJSON('{"\\u0123"', true); michael@0: testJSON('{"a"', true); michael@0: testJSON('{"a"}', true); michael@0: testJSON('{"a":', true); michael@0: testJSON('{"a",}', true); michael@0: testJSON('{"a":}', true); michael@0: testJSON('{"a":,}', true); michael@0: testJSON('{"a":5,}', true); michael@0: testJSON('{"a":5,[', true); michael@0: testJSON('{"a":5,"', true); michael@0: testJSON('{"a":5,"', true); michael@0: testJSON('{"a":5,"\\', true); michael@0: testJSON("a[false ]".substring(1, 7) /* "[false" */, true); michael@0: michael@0: testJSON('this', true); michael@0: michael@0: testJSON('[1,{}]', false); michael@0: testJSON('{}', false); michael@0: testJSON('{"a":5}', false); michael@0: testJSON('{"\\u0123":5}', false); michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(true, true); michael@0: michael@0: print("Tests complete");