diff --git a/t/105_esc_slash.t b/t/105_esc_slash.t index 495766e..f9f5334 100644 --- a/t/105_esc_slash.t +++ b/t/105_esc_slash.t @@ -1,15 +1,15 @@ - -use Test::More; -use strict; -BEGIN { plan tests => 2 }; -BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } -use JSON -support_by_pp; -######################### - -my $json = JSON->new->allow_nonref; - -my $js = '/'; - -is($json->encode($js), '"/"'); -is($json->escape_slash->encode($js), '"\/"'); - + +use Test::More; +use strict; +BEGIN { plan tests => 2 }; +BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } +use JSON -support_by_pp; +######################### + +my $json = JSON->new->allow_nonref; + +my $js = '/'; + +is($json->encode($js), '"/"'); +is($json->escape_slash->encode($js), '"\/"'); + diff --git a/t/106_allow_barekey.t b/t/106_allow_barekey.t index 042e0bd..ee31c46 100644 --- a/t/106_allow_barekey.t +++ b/t/106_allow_barekey.t @@ -1,19 +1,19 @@ - -use Test::More; -use strict; -BEGIN { plan tests => 2 }; -BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } -use JSON -support_by_pp; -######################### - -my $json = JSON->new->allow_nonref; - -eval q| $json->decode('{foo:"bar"}') |; - -ok($@); # in XS and PP, the error message differs. - -$json->allow_barekey; - -is($json->decode('{foo:"bar"}')->{foo}, 'bar'); - - + +use Test::More; +use strict; +BEGIN { plan tests => 2 }; +BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } +use JSON -support_by_pp; +######################### + +my $json = JSON->new->allow_nonref; + +eval q| $json->decode('{foo:"bar"}') |; + +ok($@); # in XS and PP, the error message differs. + +$json->allow_barekey; + +is($json->decode('{foo:"bar"}')->{foo}, 'bar'); + + diff --git a/t/107_allow_singlequote.t b/t/107_allow_singlequote.t index b1f6a6c..740a60b 100644 --- a/t/107_allow_singlequote.t +++ b/t/107_allow_singlequote.t @@ -1,20 +1,20 @@ - -use Test::More; -use strict; -BEGIN { plan tests => 4 }; -BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } -use JSON -support_by_pp; -######################### - -my $json = JSON->new->allow_nonref; - -eval q| $json->decode("{'foo':'bar'}") |; - -ok($@); # in XS and PP, the error message differs. - -$json->allow_singlequote; - -is($json->decode(q|{'foo':"bar"}|)->{foo}, 'bar'); -is($json->decode(q|{'foo':'bar'}|)->{foo}, 'bar'); -is($json->allow_barekey->decode(q|{foo:'bar'}|)->{foo}, 'bar'); - + +use Test::More; +use strict; +BEGIN { plan tests => 4 }; +BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } +use JSON -support_by_pp; +######################### + +my $json = JSON->new->allow_nonref; + +eval q| $json->decode("{'foo':'bar'}") |; + +ok($@); # in XS and PP, the error message differs. + +$json->allow_singlequote; + +is($json->decode(q|{'foo':"bar"}|)->{foo}, 'bar'); +is($json->decode(q|{'foo':'bar'}|)->{foo}, 'bar'); +is($json->allow_barekey->decode(q|{foo:'bar'}|)->{foo}, 'bar'); + diff --git a/t/e00_func.t b/t/e00_func.t index 56f091a..5708fb8 100644 --- a/t/e00_func.t +++ b/t/e00_func.t @@ -1,17 +1,17 @@ - -use Test::More; -use strict; -BEGIN { plan tests => 2 }; -BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } -use JSON; -######################### - -my $json = JSON->new; - -my $js = 'abc'; - - -is(to_json($js, {allow_nonref => 1}), '"abc"'); - -is(from_json('"abc"', {allow_nonref => 1}), 'abc'); - + +use Test::More; +use strict; +BEGIN { plan tests => 2 }; +BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } +use JSON; +######################### + +my $json = JSON->new; + +my $js = 'abc'; + + +is(to_json($js, {allow_nonref => 1}), '"abc"'); + +is(from_json('"abc"', {allow_nonref => 1}), 'abc'); +