diff options
Diffstat (limited to 'chromium/third_party/JSON/JSON-2.59/t/20_unknown.t')
-rw-r--r-- | chromium/third_party/JSON/JSON-2.59/t/20_unknown.t | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/chromium/third_party/JSON/JSON-2.59/t/20_unknown.t b/chromium/third_party/JSON/JSON-2.59/t/20_unknown.t deleted file mode 100644 index 7686929ee0a..00000000000 --- a/chromium/third_party/JSON/JSON-2.59/t/20_unknown.t +++ /dev/null @@ -1,54 +0,0 @@ - -use strict; - -use Test::More; -BEGIN { plan tests => 10 }; -BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; } - - -use strict; -use JSON; - -my $json = JSON->new; - -eval q| $json->encode( [ sub {} ] ) |; -ok( $@ =~ /encountered CODE/, $@ ); - -eval q| $json->encode( [ \-1 ] ) |; -ok( $@ =~ /cannot encode reference to scalar/, $@ ); - -eval q| $json->encode( [ \undef ] ) |; -ok( $@ =~ /cannot encode reference to scalar/, $@ ); - -eval q| $json->encode( [ \{} ] ) |; -ok( $@ =~ /cannot encode reference to scalar/, $@ ); - -$json->allow_unknown; - -is( $json->encode( [ sub {} ] ), '[null]' ); -is( $json->encode( [ \-1 ] ), '[null]' ); -is( $json->encode( [ \undef ] ), '[null]' ); -is( $json->encode( [ \{} ] ), '[null]' ); - - -SKIP: { - - skip "this test is for Perl 5.8 or later", 2 if( $] < 5.008 ); - -$json->allow_unknown(0); - -my $fh; -open( $fh, '>hoge.txt' ) or die $!; - -eval q| $json->encode( [ $fh ] ) |; -ok( $@ =~ /encountered GLOB/, $@ ); - -$json->allow_unknown(1); - -is( $json->encode( [ $fh ] ), '[null]' ); - -close $fh; - -unlink('hoge.txt'); - -} |