This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[Merge] Constants, inlined subs, TARGs, ...
[perl5.git] / cpan / JSON-PP / t / 106_allow_barekey.t
1 \r
2 use Test::More;\r
3 use strict;\r
4 BEGIN { plan tests => 2 };\r
5 BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }\r
6 use JSON::PP;\r
7 #########################\r
8 \r
9 my $json = JSON::PP->new->allow_nonref;\r
10 \r
11 eval q| $json->decode('{foo:"bar"}') |;\r
12 \r
13 ok($@); # in XS and PP, the error message differs.\r
14 \r
15 $json->allow_barekey;\r
16 \r
17 is($json->decode('{foo:"bar"}')->{foo}, 'bar');\r
18 \r
19 \r