… | |
… | |
39 | eval { JSON::XS->new->decode (\5) }; ok !!$@; # Can't coerce readonly |
39 | eval { JSON::XS->new->decode (\5) }; ok !!$@; # Can't coerce readonly |
40 | eval { JSON::XS->new->decode ([]) }; ok $@ =~ /malformed/; |
40 | eval { JSON::XS->new->decode ([]) }; ok $@ =~ /malformed/; |
41 | eval { JSON::XS->new->decode (\*STDERR) }; ok $@ =~ /malformed/; |
41 | eval { JSON::XS->new->decode (\*STDERR) }; ok $@ =~ /malformed/; |
42 | eval { JSON::XS->new->decode (*STDERR) }; ok !!$@; # cannot coerce GLOB |
42 | eval { JSON::XS->new->decode (*STDERR) }; ok !!$@; # cannot coerce GLOB |
43 | |
43 | |
44 | eval { from_json ("\"\xa0") }; ok $@ =~ /malformed.*character/; |
44 | eval { decode_json ("\"\xa0") }; ok $@ =~ /malformed.*character/; |
45 | eval { from_json ("\"\xa0\"") }; ok $@ =~ /malformed.*character/; |
45 | eval { decode_json ("\"\xa0\"") }; ok $@ =~ /malformed.*character/; |
46 | |
46 | |