1
2use Test::More;
3use strict;
4BEGIN { plan tests => 4 };
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_singlequote;
16
17is($json->decode(q|{'foo':"bar"}|)->{foo}, 'bar');
18is($json->decode(q|{'foo':'bar'}|)->{foo}, 'bar');
19is($json->allow_barekey->decode(q|{foo:'bar'}|)->{foo}, 'bar');
20
21