ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/t/18_json_checker.t
(Generate patch)

Comparing JSON-XS/t/18_json_checker.t (file contents):
Revision 1.1 by root, Wed Oct 10 17:38:47 2007 UTC vs.
Revision 1.2 by root, Thu Nov 15 20:49:12 2018 UTC

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
6use strict; 6use strict;
7no warnings; 7no warnings;
8use Test::More; 8use Test::More;
9BEGIN { plan tests => 39 }; 9BEGIN { plan tests => 38 };
10 10
11use JSON::XS; 11use JSON::XS;
12 12
13# emulate JSON_checker default config 13# emulate JSON_checker default config
14my $json = JSON::XS->new->utf8->max_depth(32)->canonical; 14my $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()}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines