Blame t/106_allow_barekey.t

Packit Service 185204
Packit Service 185204
use Test::More;
Packit Service 185204
use strict;
Packit Service 185204
BEGIN { plan tests => 2 };
Packit Service 185204
BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; }
Packit Service 185204
use JSON -support_by_pp;
Packit Service 185204
#########################
Packit Service 185204
Packit Service 185204
my $json = JSON->new->allow_nonref;
Packit Service 185204
Packit Service 185204
eval q| $json->decode('{foo:"bar"}') |;
Packit Service 185204
Packit Service 185204
ok($@); # in XS and PP, the error message differs.
Packit Service 185204
Packit Service 185204
$json->allow_barekey;
Packit Service 185204
Packit Service 185204
is($json->decode('{foo:"bar"}')->{foo}, 'bar');
Packit Service 185204
Packit Service 185204