Enhance test system
- Tests are now named - Testlogs are preserved between runs - Tests can be run through Valgrind Memcheck tool
This commit is contained in:
69
test/testdata/invalid
vendored
69
test/testdata/invalid
vendored
@@ -1,107 +1,108 @@
|
||||
==== empty ====
|
||||
====
|
||||
1
|
||||
'[' or '{' expected near end of file
|
||||
========
|
||||
==== null ====
|
||||
null
|
||||
====
|
||||
1
|
||||
'[' or '{' expected near 'null'
|
||||
========
|
||||
==== lone-open-brace ====
|
||||
{
|
||||
====
|
||||
2
|
||||
string or '}' expected near end of file
|
||||
========
|
||||
==== lone-open-bracket ====
|
||||
[
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
==== bracket-comma ====
|
||||
[,
|
||||
====
|
||||
1
|
||||
unexpected token near ','
|
||||
========
|
||||
==== bracket-one-comma ====
|
||||
[1,
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
==== unterminated-string ====
|
||||
["a
|
||||
====
|
||||
1
|
||||
unexpected newline near '"a'
|
||||
========
|
||||
==== unterminated-array ====
|
||||
["a"
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
==== apostrophe ====
|
||||
['
|
||||
====
|
||||
1
|
||||
invalid token near '''
|
||||
========
|
||||
==== brace-comma ====
|
||||
{,
|
||||
====
|
||||
1
|
||||
string or '}' expected near ','
|
||||
========
|
||||
==== unterminated-empty-key ====
|
||||
{"
|
||||
====
|
||||
1
|
||||
unexpected newline near '"'
|
||||
========
|
||||
==== unterminated-key ====
|
||||
{"a
|
||||
====
|
||||
1
|
||||
unexpected newline near '"a'
|
||||
========
|
||||
==== object-no-colon ====
|
||||
{"a"
|
||||
====
|
||||
2
|
||||
':' expected near end of file
|
||||
========
|
||||
==== object-apostrophes ====
|
||||
{'a'
|
||||
====
|
||||
1
|
||||
string or '}' expected near '''
|
||||
========
|
||||
==== object-no-value ====
|
||||
{"a":
|
||||
====
|
||||
2
|
||||
unexpected token near end of file
|
||||
========
|
||||
==== object-unterminated-value ====
|
||||
{"a":"a
|
||||
====
|
||||
1
|
||||
unexpected newline near '"a'
|
||||
========
|
||||
==== object-garbage-at-end ====
|
||||
{"a":"a" 123}
|
||||
====
|
||||
1
|
||||
'}' expected near '123'
|
||||
========
|
||||
==== unterminated-object-and-array ====
|
||||
{[
|
||||
====
|
||||
1
|
||||
string or '}' expected near '['
|
||||
========
|
||||
==== unterminated-array-and-object ====
|
||||
[{
|
||||
====
|
||||
2
|
||||
string or '}' expected near end of file
|
||||
========
|
||||
==== object-in-unterminated-array ====
|
||||
[{}
|
||||
====
|
||||
2
|
||||
']' expected near end of file
|
||||
========
|
||||
==== extra-comma-in-array ====
|
||||
[1,]
|
||||
====
|
||||
1
|
||||
unexpected token near ']'
|
||||
========
|
||||
==== extra-command-in-multiline-array ====
|
||||
[1,
|
||||
2,
|
||||
3,
|
||||
@@ -111,67 +112,67 @@ unexpected token near ']'
|
||||
====
|
||||
6
|
||||
unexpected token near ']'
|
||||
========
|
||||
==== real-truncated-at-point ====
|
||||
[1.]
|
||||
====
|
||||
1
|
||||
invalid token near '1.'
|
||||
========
|
||||
==== real-truncated-at-e ====
|
||||
[1e]
|
||||
====
|
||||
1
|
||||
invalid token near '1e'
|
||||
========
|
||||
==== real-garbage-after-e ====
|
||||
[1ea]
|
||||
====
|
||||
1
|
||||
invalid token near '1e'
|
||||
========
|
||||
==== integer-starting-with-zero ====
|
||||
[012]
|
||||
====
|
||||
1
|
||||
invalid token near '0'
|
||||
========
|
||||
==== negative-integer-starting-with-zero ====
|
||||
[-012]
|
||||
====
|
||||
1
|
||||
invalid token near '-0'
|
||||
========
|
||||
==== invalid-identifier ====
|
||||
[troo
|
||||
====
|
||||
1
|
||||
invalid token near 'troo'
|
||||
========
|
||||
==== invalid-escap ====
|
||||
["\a <-- invalid escape"]
|
||||
====
|
||||
1
|
||||
invalid escape near '"\'
|
||||
========
|
||||
==== tab-character-in-string ====
|
||||
[" <-- tab character"]
|
||||
====
|
||||
1
|
||||
control character 0x9 near '"'
|
||||
========
|
||||
==== null-byte-in-string ====
|
||||
["\u0000 (null byte not allowed)"]
|
||||
====
|
||||
1
|
||||
\u0000 is not allowed
|
||||
========
|
||||
==== truncated-unicode-surrogate ====
|
||||
["\uDADA (first surrogate without the second)"]
|
||||
====
|
||||
1
|
||||
invalid Unicode '\uDADA'
|
||||
========
|
||||
==== invalid-second-surrogate ====
|
||||
["\uD888\u3210 (first surrogate and invalid second surrogate)"]
|
||||
====
|
||||
1
|
||||
invalid Unicode '\uD888\u3210'
|
||||
========
|
||||
==== lone-second-surrogate ====
|
||||
["\uDFAA (second surrogate on it's own)"]
|
||||
====
|
||||
1
|
||||
invalid Unicode '\uDFAA'
|
||||
========
|
||||
==== unicode-identifier ====
|
||||
å
|
||||
====
|
||||
1
|
||||
|
||||
35
test/testdata/invalid-unicode
vendored
35
test/testdata/invalid-unicode
vendored
@@ -1,88 +1,89 @@
|
||||
==== lone-invalid-utf-8 ====
|
||||
<EFBFBD>
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 0
|
||||
========
|
||||
==== invalid-utf-8-in-string ====
|
||||
["<22> <-- invalid UTF-8"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 2
|
||||
========
|
||||
==== invalid-utf-8-in-array ====
|
||||
[<5B>]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 1
|
||||
========
|
||||
==== invalid-utf-8-in-identifier ====
|
||||
[a<>]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 2
|
||||
========
|
||||
==== invalid-utf-8-in-escape ====
|
||||
["\u<>"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 4
|
||||
========
|
||||
==== invalid-utf-8-after-backslash ====
|
||||
["\<5C>"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 3
|
||||
========
|
||||
==== invalid-utf-8-in-int ====
|
||||
[0<>]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 2
|
||||
========
|
||||
==== invalid-utf-8-in-bigger-int ====
|
||||
[123<32>]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 4
|
||||
========
|
||||
==== invalid-utf-8-in-real-after-e ====
|
||||
[1e<31>]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 3
|
||||
========
|
||||
==== invalid-utf-8-in-exponent ====
|
||||
[1e1<65>]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe5 at position 4
|
||||
========
|
||||
==== lone-utf-8-continuation-byte ====
|
||||
["<22>"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0x81 at position 2
|
||||
========
|
||||
==== overlong-ascii-encoding ====
|
||||
["<22>"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xc1 at position 2
|
||||
========
|
||||
==== restricted-utf-8 ====
|
||||
["<22>"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xfd at position 2
|
||||
========
|
||||
==== not-in-unicode-range ====
|
||||
["<22><><EFBFBD><EFBFBD>"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xf4 at position 2
|
||||
========
|
||||
==== overlong-3-byte-encoding ====
|
||||
["<22><><EFBFBD> <-- overlong encoding"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe0 at position 2
|
||||
========
|
||||
==== overlong-4-byte-encoding ====
|
||||
["<22><><EFBFBD><EFBFBD> <-- overlong encoding"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xf0 at position 2
|
||||
========
|
||||
==== truncated-utf-8 ====
|
||||
["<22><> <-- truncated UTF-8"]
|
||||
====
|
||||
-1
|
||||
unable to decode byte 0xe0 at position 2
|
||||
========
|
||||
==== encoded-surrogate-half ====
|
||||
["<22><><EFBFBD> <-- encoded surrogate half"]
|
||||
====
|
||||
-1
|
||||
|
||||
63
test/testdata/valid
vendored
63
test/testdata/valid
vendored
@@ -1,67 +1,68 @@
|
||||
==== empty-string ====
|
||||
[""]
|
||||
========
|
||||
==== short-string ====
|
||||
["a"]
|
||||
========
|
||||
==== simple-ascii-string ====
|
||||
["abcdefghijklmnopqrstuvwxyz1234567890 "]
|
||||
========
|
||||
==== utf-8-string ====
|
||||
["€þıœəßð some utf-8 ĸʒ×ŋµåäö𝄞"]
|
||||
========
|
||||
==== string-escapes ====
|
||||
["\"\\\/\b\f\n\r\t"]
|
||||
========
|
||||
==== one-byte-utf-8 ====
|
||||
["\u002c one-byte UTF-8"]
|
||||
========
|
||||
==== two-byte-utf-8 ====
|
||||
["\u0123 two-byte UTF-8"]
|
||||
========
|
||||
==== three-byte-utf-8 ====
|
||||
["\u0821 three-byte UTF-8"]
|
||||
========
|
||||
==== utf-surrogate-four-byte-encoding ====
|
||||
["\uD834\uDD1E surrogate, four-byte UTF-8"]
|
||||
========
|
||||
==== escaped-utf-control-char ====
|
||||
["\u0012 escaped control character"]
|
||||
========
|
||||
==== simple-int-0 ====
|
||||
[0]
|
||||
========
|
||||
==== simple-int-1 ====
|
||||
[1]
|
||||
========
|
||||
==== simple-int-123 ====
|
||||
[123]
|
||||
========
|
||||
==== negative-zero ====
|
||||
[-0]
|
||||
========
|
||||
==== negative-one ====
|
||||
[-1]
|
||||
========
|
||||
==== negative-int ====
|
||||
[-123]
|
||||
========
|
||||
==== simple-real ====
|
||||
[123.456789]
|
||||
========
|
||||
==== real-exponent ====
|
||||
[123e45]
|
||||
========
|
||||
==== real-capital-e ====
|
||||
[1E22]
|
||||
========
|
||||
==== real-positive-exponent ====
|
||||
[1e+2]
|
||||
========
|
||||
==== real-negative-exponent ====
|
||||
[1e-2]
|
||||
========
|
||||
==== real-capital-e-positive-exponent ====
|
||||
[1E+2]
|
||||
========
|
||||
==== real-capital-e-negative-exponent ====
|
||||
[1E-2]
|
||||
========
|
||||
==== real-fraction-exponent ====
|
||||
[123.456e78]
|
||||
========
|
||||
==== true ====
|
||||
[true]
|
||||
========
|
||||
==== false ====
|
||||
[false]
|
||||
========
|
||||
==== null ====
|
||||
[null]
|
||||
========
|
||||
==== empty-array ====
|
||||
[]
|
||||
========
|
||||
==== empty-object-in-array ====
|
||||
[{}]
|
||||
========
|
||||
==== complex-array ====
|
||||
[1,2,3,4,
|
||||
"a", "b", "c",
|
||||
{"foo": "bar", "core": "dump"},
|
||||
true, false, true, true, null, false
|
||||
]
|
||||
========
|
||||
==== empty-object ====
|
||||
{}
|
||||
========
|
||||
==== simple-object ====
|
||||
{"a":[]}
|
||||
|
||||
Reference in New Issue
Block a user