Debian Codegraph @

t/e90_misc.t

raw
1 use strict;
2 use Test::More tests => 4;
3
4 BEGIN {
5 $ENV{ PERL_JSON_BACKEND } ||= 'JSON::backportPP';
6 }
7
8 use JSON;
9
10 # reported by https://rt.cpan.org/Public/Bug/Display.html?id=68359
11
12 eval { JSON->to_json( 5, { allow_nonref => 1 } ) };
13 ok($@);
14
15 is( q{"5"}, JSON::to_json( "5", { allow_nonref => 1 } ) );
16 is( q{5}, JSON::to_json( 5, { allow_nonref => 1 } ) );
17 is( q{"JSON"}, JSON::to_json( 'JSON', { allow_nonref => 1 } ) );