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