Detect garbage near EOF in json_loadf() and json_load_file()
[jansson.git] / test / testdata / invalid
1 ==== empty ====
2 ====
3 1
4 '[' or '{' expected near end of file
5 ==== null ====
6 null
7 ====
8 1
9 '[' or '{' expected near 'null'
10 ==== lone-open-brace ====
11 {
12 ====
13 2
14 string or '}' expected near end of file
15 ==== lone-open-bracket ====
16 [
17 ====
18 2
19 ']' expected near end of file
20 ==== bracket-comma ====
21 [,
22 ====
23 1
24 unexpected token near ','
25 ==== bracket-one-comma ====
26 [1,
27 ====
28 2
29 ']' expected near end of file
30 ==== unterminated-string ====
31 ["a
32 ====
33 1
34 unexpected newline near '"a'
35 ==== unterminated-array ====
36 ["a"
37 ====
38 2
39 ']' expected near end of file
40 ==== apostrophe ====
41 ['
42 ====
43 1
44 invalid token near '''
45 ==== brace-comma ====
46 {,
47 ====
48 1
49 string or '}' expected near ','
50 ==== unterminated-empty-key ====
51 {"
52 ====
53 1
54 unexpected newline near '"'
55 ==== unterminated-key ====
56 {"a
57 ====
58 1
59 unexpected newline near '"a'
60 ==== object-no-colon ====
61 {"a"
62 ====
63 2
64 ':' expected near end of file
65 ==== object-apostrophes ====
66 {'a'
67 ====
68 1
69 string or '}' expected near '''
70 ==== object-no-value ====
71 {"a":
72 ====
73 2
74 unexpected token near end of file
75 ==== object-unterminated-value ====
76 {"a":"a
77 ====
78 1
79 unexpected newline near '"a'
80 ==== object-garbage-at-end ====
81 {"a":"a" 123}
82 ====
83 1
84 '}' expected near '123'
85 ==== unterminated-object-and-array ====
86 {[
87 ====
88 1
89 string or '}' expected near '['
90 ==== unterminated-array-and-object ====
91 [{
92 ====
93 2
94 string or '}' expected near end of file
95 ==== object-in-unterminated-array ====
96 [{}
97 ====
98 2
99 ']' expected near end of file
100 ==== extra-comma-in-array ====
101 [1,]
102 ====
103 1
104 unexpected token near ']'
105 ==== extra-command-in-multiline-array ====
106 [1,
107 2,
108 3,
109 4,
110 5,
111 ]
112 ====
113 6
114 unexpected token near ']'
115 ==== real-truncated-at-point ====
116 [1.]
117 ====
118 1
119 invalid token near '1.'
120 ==== real-truncated-at-e ====
121 [1e]
122 ====
123 1
124 invalid token near '1e'
125 ==== real-garbage-after-e ====
126 [1ea]
127 ====
128 1
129 invalid token near '1e'
130 ==== integer-starting-with-zero ====
131 [012]
132 ====
133 1
134 invalid token near '0'
135 ==== negative-integer-starting-with-zero ====
136 [-012]
137 ====
138 1
139 invalid token near '-0'
140 ==== invalid-identifier ====
141 [troo
142 ====
143 1
144 invalid token near 'troo'
145 ==== invalid-escap ====
146 ["\a <-- invalid escape"]
147 ====
148 1
149 invalid escape near '"\'
150 ==== tab-character-in-string ====
151 ["       <-- tab character"]
152 ====
153 1
154 control character 0x9 near '"'
155 ==== null-byte-in-string ====
156 ["\u0000 (null byte not allowed)"]
157 ====
158 1
159 \u0000 is not allowed
160 ==== truncated-unicode-surrogate ====
161 ["\uDADA (first surrogate without the second)"]
162 ====
163 1
164 invalid Unicode '\uDADA'
165 ==== invalid-second-surrogate ====
166 ["\uD888\u3210 (first surrogate and invalid second surrogate)"]
167 ====
168 1
169 invalid Unicode '\uD888\u3210'
170 ==== lone-second-surrogate ====
171 ["\uDFAA (second surrogate on it's own)"]
172 ====
173 1
174 invalid Unicode '\uDFAA'
175 ==== unicode-identifier ====
176 å
177 ====
178 1
179 '[' or '{' expected near 'å'
180 ==== ascii-unicode-identifier ====
181
182 ====
183 1
184 '[' or '{' expected near 'a'
185 ==== garbage-at-the-end ====
186 [1,2,3]foo
187 ====
188 1
189 end of file expected near 'foo'
190 ==== garbage-after-newline ====
191 [1,2,3]
192 foo
193 ====
194 2
195 end of file expected near 'foo'