diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-07-19 16:24:11 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-07-19 16:24:11 +0900 |
commit | 486774dd555cba55fb31657143ea9cc9ad64a561 (patch) | |
tree | 179ef5e1d25aacb222d27fd225d2288032276eb4 | |
parent | c1198f36fab90aacd2c28d7173d87da4b5440ab9 (diff) | |
download | perl-json-486774dd555cba55fb31657143ea9cc9ad64a561.tar.gz perl-json-486774dd555cba55fb31657143ea9cc9ad64a561.tar.bz2 perl-json-486774dd555cba55fb31657143ea9cc9ad64a561.zip |
Imported Upstream version 4.07upstream/4.07
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | META.json | 4 | ||||
-rw-r--r-- | META.yml | 2 | ||||
-rw-r--r-- | lib/JSON.pm | 2 | ||||
-rw-r--r-- | lib/JSON/backportPP.pm | 4 | ||||
-rw-r--r-- | lib/JSON/backportPP/Boolean.pm | 2 | ||||
-rw-r--r-- | t/00_pod.t | 8 | ||||
-rw-r--r-- | t/04_dwiw_encode.t | 4 | ||||
-rw-r--r-- | t/05_dwiw_decode.t | 4 | ||||
-rw-r--r-- | t/108_decode.t | 5 | ||||
-rw-r--r-- | t/120_incr_parse_truncated.t | 36 |
12 files changed, 34 insertions, 41 deletions
@@ -1,5 +1,8 @@ Revision history for Perl extension JSON. +4.07 2022-06-24 + - updated backportPP with JSON::PP 4.10 + 4.06 2022-05-22 - updated backportPP with JSON::PP 4.09 @@ -12,7 +12,6 @@ README t/00_backend_version.t t/00_load.t t/00_load_backport_pp.t -t/00_pod.t t/01_utf8.t t/02_error.t t/03_types.t @@ -48,6 +48,6 @@ "url" : "https://github.com/makamaka/JSON" } }, - "version" : "4.06", - "x_serialization_backend" : "JSON version 4.06" + "version" : "4.07", + "x_serialization_backend" : "JSON version 4.07" } @@ -24,5 +24,5 @@ requires: resources: bugtracker: https://github.com/makamaka/JSON/issues repository: https://github.com/makamaka/JSON -version: '4.06' +version: '4.07' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/lib/JSON.pm b/lib/JSON.pm index 2c7ed1e..22101ca 100644 --- a/lib/JSON.pm +++ b/lib/JSON.pm @@ -9,7 +9,7 @@ BEGIN { @JSON::ISA = 'Exporter' } @JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json); BEGIN { - $JSON::VERSION = '4.06'; + $JSON::VERSION = '4.07'; $JSON::DEBUG = 0 unless (defined $JSON::DEBUG); $JSON::DEBUG = $ENV{ PERL_JSON_DEBUG } if exists $ENV{ PERL_JSON_DEBUG }; } diff --git a/lib/JSON/backportPP.pm b/lib/JSON/backportPP.pm index 5abe6f8..1bec128 100644 --- a/lib/JSON/backportPP.pm +++ b/lib/JSON/backportPP.pm @@ -15,7 +15,7 @@ use JSON::backportPP::Boolean; use Carp (); #use Devel::Peek; -$JSON::backportPP::VERSION = '4.09'; +$JSON::backportPP::VERSION = '4.10'; @JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json); @@ -1310,7 +1310,7 @@ BEGIN { } for my $c ( unpack( $type, $str ) ) { # emulate pv_uni_display() ? - my $chr_c = $c; + my $chr_c = chr($c); $mess .= $chr_c eq '\\' ? '\\\\' : $chr_c =~ /[[:print:]]/ ? $chr_c : $chr_c eq '\a' ? '\a' diff --git a/lib/JSON/backportPP/Boolean.pm b/lib/JSON/backportPP/Boolean.pm index 15af674..30cd6b9 100644 --- a/lib/JSON/backportPP/Boolean.pm +++ b/lib/JSON/backportPP/Boolean.pm @@ -11,7 +11,7 @@ overload::import('overload', fallback => 1, ); -$JSON::backportPP::Boolean::VERSION = '4.09'; +$JSON::backportPP::Boolean::VERSION = '4.10'; 1; diff --git a/t/00_pod.t b/t/00_pod.t deleted file mode 100644 index e8e3082..0000000 --- a/t/00_pod.t +++ /dev/null @@ -1,8 +0,0 @@ -use strict; -$^W = 1; - -use Test::More; - -eval "use Test::Pod 1.00"; -plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; -all_pod_files_ok (); diff --git a/t/04_dwiw_encode.t b/t/04_dwiw_encode.t index b31cedd..de32ed7 100644 --- a/t/04_dwiw_encode.t +++ b/t/04_dwiw_encode.t @@ -7,12 +7,10 @@ use strict; use warnings; -use Test; +use Test::More tests => 5; # main { - BEGIN { plan tests => 5 } - BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } use JSON; diff --git a/t/05_dwiw_decode.t b/t/05_dwiw_decode.t index fb94f20..5cb1d60 100644 --- a/t/05_dwiw_decode.t +++ b/t/05_dwiw_decode.t @@ -7,12 +7,10 @@ use strict; use warnings; -use Test; +use Test::More tests => 7; # main { - BEGIN { plan tests => 7 } - BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } use JSON; diff --git a/t/108_decode.t b/t/108_decode.t index c575a2e..82e624f 100644 --- a/t/108_decode.t +++ b/t/108_decode.t @@ -5,7 +5,7 @@ use strict; use warnings; use Test::More; -BEGIN { plan tests => 6 }; +BEGIN { plan tests => 7 }; BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } @@ -41,3 +41,6 @@ utf8::encode($utf8); # UTF-8 flagged off is($utf8, ($isASCII) ? "\xf0\x92\x90\x80" : "\xDE\x4A\x41\x41"); +eval { $json->decode(q|{"action":"foo" "method":"bar","tid":1}|) }; +my $error = $@; +like $error => qr!""method":"bar","tid"..."!; diff --git a/t/120_incr_parse_truncated.t b/t/120_incr_parse_truncated.t index 0eb908e..8e3f5bc 100644 --- a/t/120_incr_parse_truncated.t +++ b/t/120_incr_parse_truncated.t @@ -15,7 +15,7 @@ sub run_test { run_test('{"one": 1}', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok ($res, "curly braces okay -- '$input'"); @@ -25,7 +25,7 @@ run_test('{"one": 1}', sub { run_test('{"one": 1]', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "unbalanced curly braces -- '$input'"); @@ -35,7 +35,7 @@ run_test('{"one": 1]', sub { run_test('"', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -45,7 +45,7 @@ run_test('"', sub { run_test('{', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -55,7 +55,7 @@ run_test('{', sub { run_test('[', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -65,7 +65,7 @@ run_test('[', sub { run_test('}', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -75,7 +75,7 @@ run_test('}', sub { run_test(']', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -105,7 +105,7 @@ run_test('1', sub { run_test('"1', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -115,7 +115,7 @@ run_test('"1', sub { run_test('\\', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -125,7 +125,7 @@ run_test('\\', sub { run_test('{"one": "', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -135,7 +135,7 @@ run_test('{"one": "', sub { run_test('{"one": {', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -145,7 +145,7 @@ run_test('{"one": {', sub { run_test('{"one": [', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -155,7 +155,7 @@ run_test('{"one": [', sub { run_test('{"one": t', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -165,7 +165,7 @@ run_test('{"one": t', sub { run_test('{"one": \\', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -175,7 +175,7 @@ run_test('{"one": \\', sub { run_test('{"one": ', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -185,7 +185,7 @@ run_test('{"one": ', sub { run_test('{"one": 1', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); @@ -195,7 +195,7 @@ run_test('{"one": 1', sub { run_test('{"one": {"two": 2', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated '$input'"); @@ -206,7 +206,7 @@ run_test('{"one": {"two": 2', sub { # Test Appending Closing '}' Curly Bracket run_test('{"one": 1', sub { my $input = shift; - my $coder = JSON->new; + my $coder = JSON->new->allow_nonref(1); my $res = eval { $coder->incr_parse($input) }; my $e = $@; # test more clobbers $@, we need it twice ok (!$res, "truncated input='$input'"); |