Add some tests
This commit is contained in:
138
test/testdata/invalid
vendored
Normal file
138
test/testdata/invalid
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
====
|
||||
1
|
||||
'[' or '{' expected near end of file
|
||||
========
|
||||
null
|
||||
====
|
||||
1
|
||||
'[' or '{' expected near 'null'
|
||||
========
|
||||
{
|
||||
====
|
||||
2
|
||||
'}' expected near end of file
|
||||
========
|
||||
[
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
[,
|
||||
====
|
||||
1
|
||||
unexpected token near ','
|
||||
========
|
||||
[1,
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
["a
|
||||
====
|
||||
1
|
||||
invalid token near '"a'
|
||||
========
|
||||
["a"
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
['
|
||||
====
|
||||
1
|
||||
invalid token near '''
|
||||
========
|
||||
{,
|
||||
====
|
||||
1
|
||||
string expected near ','
|
||||
========
|
||||
{"
|
||||
====
|
||||
1
|
||||
string expected near '"'
|
||||
========
|
||||
{"a
|
||||
====
|
||||
1
|
||||
string expected near '"a'
|
||||
========
|
||||
{"a"
|
||||
====
|
||||
2
|
||||
':' expected near end of file
|
||||
========
|
||||
{'a'
|
||||
====
|
||||
1
|
||||
string expected near '''
|
||||
========
|
||||
{"a":
|
||||
====
|
||||
2
|
||||
unexpected token near end of file
|
||||
========
|
||||
{"a":"a
|
||||
====
|
||||
1
|
||||
invalid token near '"a'
|
||||
========
|
||||
{[
|
||||
====
|
||||
1
|
||||
string expected near '['
|
||||
========
|
||||
[{
|
||||
====
|
||||
2
|
||||
'}' expected near end of file
|
||||
========
|
||||
[{}
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
[1,]
|
||||
====
|
||||
1
|
||||
unexpected token near ']'
|
||||
========
|
||||
[1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
]
|
||||
====
|
||||
6
|
||||
unexpected token near ']'
|
||||
========
|
||||
[1.]
|
||||
====
|
||||
1
|
||||
invalid token near '1.'
|
||||
========
|
||||
[1e]
|
||||
====
|
||||
1
|
||||
invalid token near '1e'
|
||||
========
|
||||
[1ea]
|
||||
====
|
||||
1
|
||||
invalid token near '1e'
|
||||
========
|
||||
[012]
|
||||
====
|
||||
1
|
||||
invalid token near '0'
|
||||
========
|
||||
[-012]
|
||||
====
|
||||
1
|
||||
invalid token near '-0'
|
||||
========
|
||||
[" <-- tab character"]
|
||||
====
|
||||
1
|
||||
invalid token near '"'
|
||||
57
test/testdata/valid
vendored
Normal file
57
test/testdata/valid
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
[""]
|
||||
========
|
||||
["a"]
|
||||
========
|
||||
["abcdefghijklmnopqrstuvwxyz1234567890 "]
|
||||
========
|
||||
["€þıœəßð some utf-8 ĸʒ×ŋµåäö"]
|
||||
========
|
||||
["\"\\\/\b\f\n\r\t"]
|
||||
========
|
||||
[0]
|
||||
========
|
||||
[1]
|
||||
========
|
||||
[123]
|
||||
========
|
||||
[-0]
|
||||
========
|
||||
[-1]
|
||||
========
|
||||
[-123]
|
||||
========
|
||||
[123.456789]
|
||||
========
|
||||
[123e45]
|
||||
========
|
||||
[1E22]
|
||||
========
|
||||
[1e+2]
|
||||
========
|
||||
[1e-2]
|
||||
========
|
||||
[1E+2]
|
||||
========
|
||||
[1E-2]
|
||||
========
|
||||
[123.456e78]
|
||||
========
|
||||
[true]
|
||||
========
|
||||
[false]
|
||||
========
|
||||
[null]
|
||||
========
|
||||
[]
|
||||
========
|
||||
[{}]
|
||||
========
|
||||
[1,2,3,4,
|
||||
"a", "b", "c",
|
||||
{"foo": "bar", "core": "dump"},
|
||||
true, false, true, true, null, false
|
||||
]
|
||||
========
|
||||
{}
|
||||
========
|
||||
{"a":[]}
|
||||
Reference in New Issue
Block a user