File: e90_misc.t

package info (click to toggle)
libjson-perl 2.61-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 572 kB
  • ctags: 148
  • sloc: perl: 2,419; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 452 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

use strict;
use Test::More tests => 4;

BEGIN {
    $ENV{ PERL_JSON_BACKEND } = $ARGV[0] || '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 } ) );