|
1 // Any copyright is dedicated to the Public Domain. |
|
2 // http://creativecommons.org/licenses/publicdomain/ |
|
3 |
|
4 testJSON('[', true); |
|
5 testJSON('[1', true); |
|
6 testJSON('[1,]', true); |
|
7 testJSON('[1,{', true); |
|
8 testJSON('[1,}', true); |
|
9 testJSON('[1,{]', true); |
|
10 testJSON('[1,}]', true); |
|
11 testJSON('[1,{"', true); |
|
12 testJSON('[1,}"', true); |
|
13 testJSON('[1,{"\\', true); |
|
14 testJSON('[1,}"\\', true); |
|
15 testJSON('[1,"', true); |
|
16 testJSON('[1,"\\', true); |
|
17 |
|
18 testJSON('{', true); |
|
19 testJSON('{1', true); |
|
20 testJSON('{,', true); |
|
21 testJSON('{"', true); |
|
22 testJSON('{"\\', true); |
|
23 testJSON('{"\\u', true); |
|
24 testJSON('{"\\uG', true); |
|
25 testJSON('{"\\u0', true); |
|
26 testJSON('{"\\u01', true); |
|
27 testJSON('{"\\u012', true); |
|
28 testJSON('{"\\u0123', true); |
|
29 testJSON('{"\\u0123"', true); |
|
30 testJSON('{"a"', true); |
|
31 testJSON('{"a"}', true); |
|
32 testJSON('{"a":', true); |
|
33 testJSON('{"a",}', true); |
|
34 testJSON('{"a":}', true); |
|
35 testJSON('{"a":,}', true); |
|
36 testJSON('{"a":5,}', true); |
|
37 testJSON('{"a":5,[', true); |
|
38 testJSON('{"a":5,"', true); |
|
39 testJSON('{"a":5,"', true); |
|
40 testJSON('{"a":5,"\\', true); |
|
41 testJSON("a[false ]".substring(1, 7) /* "[false" */, true); |
|
42 |
|
43 testJSON('this', true); |
|
44 |
|
45 testJSON('[1,{}]', false); |
|
46 testJSON('{}', false); |
|
47 testJSON('{"a":5}', false); |
|
48 testJSON('{"\\u0123":5}', false); |
|
49 |
|
50 /******************************************************************************/ |
|
51 |
|
52 if (typeof reportCompare === "function") |
|
53 reportCompare(true, true); |
|
54 |
|
55 print("Tests complete"); |