|
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 | + }, |
| 122 | + { |
| 123 | + "comment": "Function syntax errors", |
| 124 | + "given": {}, |
| 125 | + "cases": [ |
| 126 | + { |
| 127 | + "comment": "invalid start of function", |
| 128 | + "expression": "@(foo)", |
| 129 | + "error": "syntax" |
| 130 | + }, |
| 131 | + { |
| 132 | + "comment": "function names cannot be quoted", |
| 133 | + "expression": "\"foo\"(bar)", |
| 134 | + "error": "syntax" |
| 135 | + } |
| 136 | + ] |
| 137 | + }, |
119 | 138 | {
|
120 | 139 | "comment": "Wildcard syntax",
|
121 | 140 | "given": {"type": "object"},
|
|
199 | 218 | {
|
200 | 219 | "expression": "foo[#]",
|
201 | 220 | "error": "syntax"
|
| 221 | + }, |
| 222 | + { |
| 223 | + "comment": "missing rbracket for led wildcard index", |
| 224 | + "expression": "led[*", |
| 225 | + "error": "syntax" |
| 226 | + } |
| 227 | + ] |
| 228 | + }, |
| 229 | + { |
| 230 | + "comment": "slice syntax", |
| 231 | + "given": {}, |
| 232 | + "cases": [ |
| 233 | + { |
| 234 | + "comment": "slice expected colon or rbracket", |
| 235 | + "expression": "[:@]", |
| 236 | + "error": "syntax" |
| 237 | + }, |
| 238 | + { |
| 239 | + "comment": "slice has too many colons", |
| 240 | + "expression": "[:::]", |
| 241 | + "error": "syntax" |
| 242 | + }, |
| 243 | + { |
| 244 | + "comment": "slice expected number", |
| 245 | + "expression": "[:@:]", |
| 246 | + "error": "syntax" |
| 247 | + }, |
| 248 | + { |
| 249 | + "comment": "slice expected number of colon", |
| 250 | + "expression": "[:1@]", |
| 251 | + "error": "syntax" |
202 | 252 | }
|
203 | 253 | ]
|
204 | 254 | },
|
|
358 | 408 | "expression": "a.{foo}",
|
359 | 409 | "error": "syntax"
|
360 | 410 | },
|
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 | 411 | {
|
372 | 412 | "comment": "Valid multi-select hash extraction",
|
373 | 413 | "expression": "a.{foo: bar}",
|
|
402 | 442 | "comment": "Nested multi select",
|
403 | 443 | "expression": "{\"\\\\\":{\" \":*}}",
|
404 | 444 | "result": {"\\": {" ": ["object"]}}
|
| 445 | + }, |
| 446 | + { |
| 447 | + "comment": "Missing closing } after a valid nud", |
| 448 | + "expression": "{a: @", |
| 449 | + "error": "syntax" |
405 | 450 | }
|
406 | 451 | ]
|
407 | 452 | },
|
|
574 | 619 | "comment": "Two level flattened projection of a literal",
|
575 | 620 | "expression": "twolen[].threelen[].`\"bar\"`",
|
576 | 621 | "error": "syntax"
|
| 622 | + }, |
| 623 | + { |
| 624 | + "comment": "expects closing ]", |
| 625 | + "expression": "foo[? @ | @", |
| 626 | + "error": "syntax" |
577 | 627 | }
|
578 | 628 | ]
|
579 | 629 | },
|
|
592 | 642 | {
|
593 | 643 | "expression": "\"\\\\\"",
|
594 | 644 | "result": null
|
| 645 | + }, |
| 646 | + { |
| 647 | + "expression": "\"\\u\"", |
| 648 | + "error": "syntax" |
595 | 649 | }
|
596 | 650 | ]
|
597 | 651 | },
|
|
0 commit comments