|
14 | 14 | "expression": "foo.-11",
|
15 | 15 | "error": "syntax"
|
16 | 16 | },
|
17 |
| - { |
18 |
| - "expression": "foo", |
19 |
| - "result": null |
20 |
| - }, |
21 |
| - { |
22 |
| - "expression": "foo.", |
23 |
| - "error": "syntax" |
24 |
| - }, |
25 | 17 | {
|
26 | 18 | "expression": "foo.",
|
27 | 19 | "error": "syntax"
|
|
116 | 108 | }
|
117 | 109 | ]
|
118 | 110 | },
|
| 111 | + { |
| 112 | + "comment": "Paren syntax errors", |
| 113 | + "given": {}, |
| 114 | + "cases": [ |
| 115 | + { |
| 116 | + "comment": "missing closing paren", |
| 117 | + "expression": "(@", |
| 118 | + "error": "syntax" |
| 119 | + } |
| 120 | + ] |
| 121 | + }, |
119 | 122 | {
|
120 | 123 | "comment": "Wildcard syntax",
|
121 | 124 | "given": {"type": "object"},
|
|
199 | 202 | {
|
200 | 203 | "expression": "foo[#]",
|
201 | 204 | "error": "syntax"
|
| 205 | + }, |
| 206 | + { |
| 207 | + "comment": "missing rbracket for led wildcard index", |
| 208 | + "expression": "led[*", |
| 209 | + "error": "syntax" |
| 210 | + } |
| 211 | + ] |
| 212 | + }, |
| 213 | + { |
| 214 | + "comment": "slice syntax", |
| 215 | + "given": {}, |
| 216 | + "cases": [ |
| 217 | + { |
| 218 | + "comment": "slice expected colon or rbracket", |
| 219 | + "expression": "[:@]", |
| 220 | + "error": "syntax" |
| 221 | + }, |
| 222 | + { |
| 223 | + "comment": "slice has too many colons", |
| 224 | + "expression": "[:::]", |
| 225 | + "error": "syntax" |
| 226 | + }, |
| 227 | + { |
| 228 | + "comment": "slice expected number", |
| 229 | + "expression": "[:@:]", |
| 230 | + "error": "syntax" |
| 231 | + }, |
| 232 | + { |
| 233 | + "comment": "slice expected number of colon", |
| 234 | + "expression": "[:1@]", |
| 235 | + "error": "syntax" |
202 | 236 | }
|
203 | 237 | ]
|
204 | 238 | },
|
|
358 | 392 | "expression": "a.{foo}",
|
359 | 393 | "error": "syntax"
|
360 | 394 | },
|
361 |
| - { |
362 |
| - "comment": "Missing value", |
363 |
| - "expression": "a.{foo:}", |
364 |
| - "error": "syntax" |
365 |
| - }, |
366 |
| - { |
367 |
| - "comment": "Missing value with trailing comma", |
368 |
| - "expression": "a.{foo: ,}", |
369 |
| - "error": "syntax" |
370 |
| - }, |
371 | 395 | {
|
372 | 396 | "comment": "Valid multi-select hash extraction",
|
373 | 397 | "expression": "a.{foo: bar}",
|
|
402 | 426 | "comment": "Nested multi select",
|
403 | 427 | "expression": "{\"\\\\\":{\" \":*}}",
|
404 | 428 | "result": {"\\": {" ": ["object"]}}
|
| 429 | + }, |
| 430 | + { |
| 431 | + "comment": "Missing closing } after a valid nud", |
| 432 | + "expression": "{a: @", |
| 433 | + "error": "syntax" |
405 | 434 | }
|
406 | 435 | ]
|
407 | 436 | },
|
|
574 | 603 | "comment": "Two level flattened projection of a literal",
|
575 | 604 | "expression": "twolen[].threelen[].`\"bar\"`",
|
576 | 605 | "error": "syntax"
|
| 606 | + }, |
| 607 | + { |
| 608 | + "comment": "expects closing ]", |
| 609 | + "expression": "foo[? @ | @", |
| 610 | + "error": "syntax" |
577 | 611 | }
|
578 | 612 | ]
|
579 | 613 | },
|
|
592 | 626 | {
|
593 | 627 | "expression": "\"\\\\\"",
|
594 | 628 | "result": null
|
| 629 | + }, |
| 630 | + { |
| 631 | + "expression": "\"\\u\"", |
| 632 | + "error": "syntax" |
595 | 633 | }
|
596 | 634 | ]
|
597 | 635 | },
|
|
0 commit comments