File: e90_misc.t

package info (click to toggle)
libjson-perl 4.03000-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 604 kB
  • sloc: perl: 1,957; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 425 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use Test::More tests => 4;

BEGIN {
    $ENV{ PERL_JSON_BACKEND } ||= 'JSON::backportPP';
}

use JSON;

# reported by https://rt.cpan.org/Public/Bug/Display.html?id=68359

eval { JSON->to_json( 5, { allow_nonref => 1 } ) };
ok($@);

is( q{"5"}, JSON::to_json( "5", { allow_nonref => 1 } ) );
is( q{5},  JSON::to_json( 5, { allow_nonref => 1 } ) );
is( q{"JSON"}, JSON::to_json( 'JSON', { allow_nonref => 1 } ) );