Implement JSON_ENSURE_ASCII encoding flag
[jansson.git] / test / testdata / invalid
index df167ae..7fede67 100644 (file)
+==== 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,
@@ -106,33 +112,124 @@ 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'
-========
+==== real-positive-overflow ====
+[123123e100000]
+====
+1
+real number overflow near '123123e100000'
+==== real-negative-overflow ====
+[-123123e100000]
+====
+1
+real number overflow near '-123123e100000'
+==== real-underflow ====
+[123e-10000000]
+====
+1
+real number underflow near '123e-10000000'
+==== integer-starting-with-zero ====
 [012]
 ====
 1
 invalid token near '0'
-========
+==== negative-integer-starting-with-zero ====
 [-012]
 ====
 1
 invalid token near '-0'
-========
+==== too-big-positive-integer ====
+[123123123123123]
+====
+1
+too big integer near '123123123123123'
+==== too-big-negative-integer ====
+[-123123123123123]
+====
+1
+too big negative integer near '-123123123123123'
+==== invalid-identifier ====
+[troo
+====
+1
+invalid token near 'troo'
+==== minus-sign-without-number ====
+[-foo]
+====
+1
+invalid token near '-'
+==== invalid-negative-integerr ====
+[-123foo]
+====
+1
+']' expected near 'foo'
+==== invalid-negative-real ====
+[-123.123foo]
+====
+1
+']' expected near 'foo'
+==== invalid-escape ====
+["\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
+'[' or '{' expected near 'å'
+==== ascii-unicode-identifier ====
+aå
+====
+1
+'[' or '{' expected near 'a'
+==== garbage-at-the-end ====
+[1,2,3]foo
+====
+1
+end of file expected near 'foo'
+==== garbage-after-newline ====
+[1,2,3]
+foo
+====
+2
+end of file expected near 'foo'