1
2use Test::More;
3use strict;
4BEGIN { plan tests => 2 };
5BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }
6use JSON;
7#########################
8
9my $json = JSON->new->allow_nonref;
10
11eval q| $json->decode('{foo:"bar"}') |;
12
13ok($@); # in XS and PP, the error message differs.
14
15$json->allow_barekey;
16
17is($json->decode('{foo:"bar"}')->{foo}, 'bar');
18
19
20