… | |
… | |
4 | # except for fail18.json, as we do not support a depth of 20 (but 16 and 32). |
4 | # except for fail18.json, as we do not support a depth of 20 (but 16 and 32). |
5 | |
5 | |
6 | use strict; |
6 | use strict; |
7 | no warnings; |
7 | no warnings; |
8 | use Test::More; |
8 | use Test::More; |
9 | BEGIN { plan tests => 39 }; |
9 | BEGIN { plan tests => 38 }; |
10 | |
10 | |
11 | use JSON::XS; |
11 | use JSON::XS; |
12 | |
12 | |
13 | # emulate JSON_checker default config |
13 | # emulate JSON_checker default config |
14 | my $json = JSON::XS->new->utf8->max_depth(32)->canonical; |
14 | my $json = JSON::XS->new->utf8->max_depth(32)->canonical; |
… | |
… | |
29 | ok ($name =~ /^fail/, "$name ($@)"); |
29 | ok ($name =~ /^fail/, "$name ($@)"); |
30 | } |
30 | } |
31 | } |
31 | } |
32 | |
32 | |
33 | __DATA__ |
33 | __DATA__ |
34 | "A JSON payload should be an object or array, not a string." |
|
|
35 | # fail1.json |
|
|
36 | {"Extra value after close": true} "misplaced quoted value" |
34 | {"Extra value after close": true} "misplaced quoted value" |
37 | # fail10.json |
35 | # fail10.json |
38 | {"Illegal expression": 1 + 2} |
36 | {"Illegal expression": 1 + 2} |
39 | # fail11.json |
37 | # fail11.json |
40 | {"Illegal invocation": alert()} |
38 | {"Illegal invocation": alert()} |