diff -Nru libjson-perl-2.61/Changes libjson-perl-2.90/Changes --- libjson-perl-2.61/Changes 2013-10-17 10:59:11.000000000 +0000 +++ libjson-perl-2.90/Changes 2013-10-31 10:36:05.000000000 +0000 @@ -1,18 +1,52 @@ Revision history for Perl extension JSON. -## JSON version 2.xx ##################################################### +## JSON version 2.9 ##################################################### -From version 1.xx to 2.xx, JSON was totally rewritten. +CAUTION!!! +INCOMPATIBLE CHANGE - * JSON becomes a wrapper to JSON::XS or JSON::PP! - * objToJson() and jsonToObj() are obsoleted! - * $JSON::* variables are no longer available! - * JSON::Parser and JSON::Converter are deleted from the distribution! - * JSONRPC* and Apache::JSONRPC are deleted from the distribution! - Please check JSON::RPC (supports JSON-RPC protocol v1.1 and 1.0). +JSON.pm had patched JSON::XS::Boolean and JSON::PP::Boolean internally +on loading time for making these modules inherit JSON::Boolean. +But since JSON::XS v3.0 it use Types::Serialiser as boolean class. +Then now JSON.pm breaks boolean classe overload features and +-support_by_pp if JSON::XS v3.0 or later is installed. + +JSON::true and JSON::false returned JSON::Boolean objects. +For workaround, they return JSON::PP::Boolean objects in this version. + + isa_ok(JSON::true, 'JSON::PP::Boolean'); + +And it discards a feature: + + ok(JSON::true eq 'true'); + +In other word, JSON::PP::Boolean overload numeric only. + + ok( JSON::true == 1 ); ########################################################################## +2.90 Wed Oct 30 19:48:43 2013 + + **** Please see to the headline in this file. **** + + - workaround for JSON::XS version 3.0 or later installed case. + + * the objects returned by JSON::true/false are JSON::PP::Boolean. + * they do not overload 'eq'. + + - changed test cases for this patch. + + t/e02_bool.t + t/e03_bool2.t + t/x17_strange_overload.t + t/xe02_bool.t + t/xe03_bool2.t + t/xe12_boolean.t + + **** Please see to the headline in this file. **** + + 2.61 Thu Oct 17 19:38:55 2013 - fixed return/or in _incr_parse reported and patched by MAUKE, sprout and rjbs diff -Nru libjson-perl-2.61/debian/changelog libjson-perl-2.90/debian/changelog --- libjson-perl-2.61/debian/changelog 2013-10-19 19:04:48.000000000 +0000 +++ libjson-perl-2.90/debian/changelog 2015-07-07 19:31:29.000000000 +0000 @@ -1,3 +1,24 @@ +libjson-perl (2.90-1) unstable; urgency=medium + + [ gregor herrmann ] + * New upstream release. + Fixes "FTBFS: Recursive inheritance detected" + (Closes: #791709) + * Declare compliance with Debian Policy 3.9.5. + * Strip trailing slash from metacpan URLs. + + [ Salvatore Bonaccorso ] + * Update Vcs-Browser URL to cgit web frontend + + [ gregor herrmann ] + * Add debian/upstream/metadata + * Update years of packaging copyright. + * Mark package as autopkgtest-able. + * Declare compliance with Debian Policy 3.9.6. + * Add patch to fix language in documentation. + + -- gregor herrmann Tue, 07 Jul 2015 21:31:15 +0200 + libjson-perl (2.61-1) unstable; urgency=low * Team upload diff -Nru libjson-perl-2.61/debian/control libjson-perl-2.90/debian/control --- libjson-perl-2.61/debian/control 2013-06-28 05:47:36.000000000 +0000 +++ libjson-perl-2.90/debian/control 2015-07-07 19:31:29.000000000 +0000 @@ -9,15 +9,16 @@ gregor herrmann , Xavier Guimard Section: perl +Testsuite: autopkgtest-pkg-perl Priority: optional Build-Depends: debhelper (>= 8) Build-Depends-Indep: libjson-xs-perl (>= 2.340), libtest-pod-perl, perl -Standards-Version: 3.9.4 -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libjson-perl.git +Standards-Version: 3.9.6 +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libjson-perl.git Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libjson-perl.git -Homepage: https://metacpan.org/release/JSON/ +Homepage: https://metacpan.org/release/JSON Package: libjson-perl Architecture: all @@ -34,4 +35,3 @@ implementation. It prefers either JSON::XS (see libjson-xs-perl) or JSON::PP (see libjson-pp-perl), but will fall back on a backport implementation if neither are available. - diff -Nru libjson-perl-2.61/debian/copyright libjson-perl-2.90/debian/copyright --- libjson-perl-2.61/debian/copyright 2013-08-16 15:17:08.000000000 +0000 +++ libjson-perl-2.90/debian/copyright 2015-07-07 19:31:29.000000000 +0000 @@ -1,6 +1,6 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: JSON -Source: https://metacpan.org/release/JSON/ +Source: https://metacpan.org/release/JSON Upstream-Contact: Makamaka Hannyaharamitu, Files: * @@ -13,7 +13,7 @@ 2009-2011, Ansgar Burchardt 2009, Nathan Handler 2010, Krzysztof Krzyżaniak (eloy) - 2010-2013, gregor herrmann + 2010-2015, gregor herrmann 2011, Jonathan Yu 2013, Xavier Guimard License: Artistic or GPL-1+ diff -Nru libjson-perl-2.61/debian/patches/series libjson-perl-2.90/debian/patches/series --- libjson-perl-2.61/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ libjson-perl-2.90/debian/patches/series 2015-07-07 19:31:29.000000000 +0000 @@ -0,0 +1 @@ +wording.patch diff -Nru libjson-perl-2.61/debian/patches/wording.patch libjson-perl-2.90/debian/patches/wording.patch --- libjson-perl-2.61/debian/patches/wording.patch 1970-01-01 00:00:00.000000000 +0000 +++ libjson-perl-2.90/debian/patches/wording.patch 2015-07-07 19:31:29.000000000 +0000 @@ -0,0 +1,40 @@ +Description: fix expression "allow to" in documentation +Origin: vendor +Author: gregor herrmann +Last-Update: 2015-07-07 +Forwarded: https://rt.cpan.org/Ticket/Display.html?id=105735 +Bug: https://rt.cpan.org/Ticket/Display.html?id=105735 + +--- a/README ++++ b/README +@@ -1071,7 +1071,7 @@ + $json = $json->loose([$enable]) + + The unescaped [\x00-\x1f\x22\x2f\x5c] strings are invalid in JSON +- strings and the module doesn't allow to "decode" to these (except for ++ strings and the module doesn't allow one to "decode" to these (except for + \x2f). If $enable is true (or missing), then "decode" will accept these + unescaped strings. + +--- a/lib/JSON.pm ++++ b/lib/JSON.pm +@@ -1718,7 +1718,7 @@ + $json = $json->loose([$enable]) + + The unescaped [\x00-\x1f\x22\x2f\x5c] strings are invalid in JSON strings +-and the module doesn't allow to C to these (except for \x2f). ++and the module doesn't allow one to C to these (except for \x2f). + If C<$enable> is true (or missing), then C will accept these + unescaped strings. + +--- a/lib/JSON/backportPP.pm ++++ b/lib/JSON/backportPP.pm +@@ -2446,7 +2446,7 @@ + $json = $json->loose([$enable]) + + The unescaped [\x00-\x1f\x22\x2f\x5c] strings are invalid in JSON strings +-and the module doesn't allow to C to these (except for \x2f). ++and the module doesn't allow one to C to these (except for \x2f). + If C<$enable> is true (or missing), then C will accept these + unescaped strings. + diff -Nru libjson-perl-2.61/debian/tests/pkg-perl/skip-syntax libjson-perl-2.90/debian/tests/pkg-perl/skip-syntax --- libjson-perl-2.61/debian/tests/pkg-perl/skip-syntax 1970-01-01 00:00:00.000000000 +0000 +++ libjson-perl-2.90/debian/tests/pkg-perl/skip-syntax 2015-07-07 19:31:29.000000000 +0000 @@ -0,0 +1,3 @@ +# needs JSON:PP, in Suggests (although it's in perl core as well, but +# otherwise all tests are kipped) +JSON/backportPP.pm diff -Nru libjson-perl-2.61/debian/upstream/metadata libjson-perl-2.90/debian/upstream/metadata --- libjson-perl-2.61/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ libjson-perl-2.90/debian/upstream/metadata 2015-07-07 19:31:29.000000000 +0000 @@ -0,0 +1,5 @@ +--- +Archive: CPAN +Contact: Makamaka Hannyaharamitu, Emakamaka[at]cpan.orgE +Name: JSON +Repository: https://github.com/makamaka/JSON diff -Nru libjson-perl-2.61/debian/watch libjson-perl-2.90/debian/watch --- libjson-perl-2.61/debian/watch 2013-03-29 17:05:33.000000000 +0000 +++ libjson-perl-2.90/debian/watch 2015-07-07 19:31:29.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -https://metacpan.org/release/JSON/ .*/JSON-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ +https://metacpan.org/release/JSON .*/JSON-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ diff -Nru libjson-perl-2.61/lib/JSON/backportPP.pm libjson-perl-2.90/lib/JSON/backportPP.pm --- libjson-perl-2.61/lib/JSON/backportPP.pm 2013-10-17 10:57:01.000000000 +0000 +++ libjson-perl-2.90/lib/JSON/backportPP.pm 2013-10-31 10:36:05.000000000 +0000 @@ -13,7 +13,7 @@ #use Devel::Peek; use vars qw($VERSION); -$VERSION = '2.27203'; +$VERSION = '2.27204'; @JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json); @@ -1394,8 +1394,22 @@ # shamelessly copied and modified from JSON::XS code. -$JSON::PP::true = do { bless \(my $dummy = 1), "JSON::backportPP::Boolean" }; -$JSON::PP::false = do { bless \(my $dummy = 0), "JSON::backportPP::Boolean" }; +unless ( $INC{'JSON/PP.pm'} ) { + eval q| + package + JSON::PP::Boolean; + + use overload ( + "0+" => sub { ${$_[0]} }, + "++" => sub { $_[0] = ${$_[0]} + 1 }, + "--" => sub { $_[0] = ${$_[0]} - 1 }, + fallback => 1, + ); + |; +} + +$JSON::PP::true = do { bless \(my $dummy = 1), "JSON::PP::Boolean" }; +$JSON::PP::false = do { bless \(my $dummy = 0), "JSON::PP::Boolean" }; sub is_bool { defined $_[0] and UNIVERSAL::isa($_[0], "JSON::PP::Boolean"); } @@ -1405,17 +1419,6 @@ ############################### -package JSON::backportPP::Boolean; - -@JSON::backportPP::Boolean::ISA = ('JSON::PP::Boolean'); -use overload ( - "0+" => sub { ${$_[0]} }, - "++" => sub { $_[0] = ${$_[0]} + 1 }, - "--" => sub { $_[0] = ${$_[0]} - 1 }, - fallback => 1, -); - - ############################### package # hide from PAUSE diff -Nru libjson-perl-2.61/lib/JSON.pm libjson-perl-2.90/lib/JSON.pm --- libjson-perl-2.61/lib/JSON.pm 2013-10-17 10:57:45.000000000 +0000 +++ libjson-perl-2.90/lib/JSON.pm 2013-10-31 10:36:05.000000000 +0000 @@ -7,7 +7,7 @@ @JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json); BEGIN { - $JSON::VERSION = '2.61'; + $JSON::VERSION = '2.90'; $JSON::DEBUG = 0 unless (defined $JSON::DEBUG); $JSON::DEBUG = $ENV{ PERL_JSON_DEBUG } if exists $ENV{ PERL_JSON_DEBUG }; } @@ -32,7 +32,7 @@ allow_blessed convert_blessed shrink max_depth max_size allow_unknown /; -my @XSOnlyMethods = qw//; # Currently nothing +my @XSOnlyMethods = qw/allow_tags/; # Currently nothing my @PPOnlyMethods = qw/ indent_length sort_by @@ -172,6 +172,7 @@ } + sub true { $JSON::true } sub false { $JSON::false } @@ -321,7 +322,10 @@ $JSON::false = ${"$module\::false"}; push @JSON::ISA, $module; - push @{"$module\::Boolean::ISA"}, qw(JSON::Boolean); + if ( JSON->is_xs and JSON->backend->VERSION < 3 ) { + eval 'package JSON::PP::Boolean'; + push @{"$module\::Boolean::ISA"}, qw(JSON::PP::Boolean); + } *{"JSON::is_bool"} = \&{"$module\::is_bool"}; @@ -346,6 +350,7 @@ my %Installed; sub _overrride_overload { + return; # this function is currently disable. return if ($Installed{ $_[0] }++); my $boolean = $_[0] . '::Boolean'; @@ -486,8 +491,8 @@ $pkg->_make_unsupported_method($method => $type); } - push @{"JSON::XS::Boolean::ISA"}, qw(JSON::PP::Boolean); - push @{"JSON::PP::Boolean::ISA"}, qw(JSON::Boolean); +# push @{"JSON::XS::Boolean::ISA"}, qw(JSON::PP::Boolean); +# push @{"JSON::PP::Boolean::ISA"}, qw(JSON::Boolean); $JSON::DEBUG and Carp::carp("set -support_by_pp mode."); @@ -655,9 +660,10 @@ =head1 VERSION - 2.59 + 2.90 This version is compatible with JSON::XS B<2.34> and later. +(Not yet compatble to JSON::XS B<3.0x>.) =head1 NOTE @@ -681,6 +687,31 @@ =head1 DESCRIPTION + *************************** CAUTION ************************************** + * * + * INCOMPATIBLE CHANGE (JSON::XS version 2.90) * + * * + * JSON.pm had patched JSON::XS::Boolean and JSON::PP::Boolean internally * + * on loading time for making these modules inherit JSON::Boolean. * + * But since JSON::XS v3.0 it use Types::Serialiser as boolean class. * + * Then now JSON.pm breaks boolean classe overload features and * + * -support_by_pp if JSON::XS v3.0 or later is installed. * + * * + * JSON::true and JSON::false returned JSON::Boolean objects. * + * For workaround, they return JSON::PP::Boolean objects in this version. * + * * + * isa_ok(JSON::true, 'JSON::PP::Boolean'); * + * * + * And it discards a feature: * + * * + * ok(JSON::true eq 'true'); * + * * + * In other word, JSON::PP::Boolean overload numeric only. * + * * + * ok( JSON::true == 1 ); * + * * + ************************************************************************** + ************************** CAUTION ******************************** * This is 'JSON module version 2' and there are many differences * * to version 1.xx * @@ -1798,15 +1829,9 @@ C<1> and C<0>. You can check whether a scalar is a JSON boolean by using the C function. -If C and C are used as strings or compared as strings, -they represent as C and C respectively. - - print JSON::true . "\n"; - => true print JSON::true + 1; => 1 - ok(JSON::true eq 'true'); ok(JSON::true eq '1'); ok(JSON::true == 1); diff -Nru libjson-perl-2.61/Makefile.PL libjson-perl-2.90/Makefile.PL --- libjson-perl-2.61/Makefile.PL 2013-10-17 10:54:18.000000000 +0000 +++ libjson-perl-2.90/Makefile.PL 2013-10-31 10:36:05.000000000 +0000 @@ -29,6 +29,32 @@ ============================= $message + *************************** CAUTION ************************************** + * * + * INCOMPATIBLE CHANGE (JSON::XS version 2.90) * + * * + * JSON.pm had patched JSON::XS::Boolean and JSON::PP::Boolean internally * + * on loading time for making these modules inherit JSON::Boolean. * + * But since JSON::XS v3.0 it use Types::Serialiser as boolean class. * + * Then now JSON.pm breaks boolean classe overload features and * + * -support_by_pp if JSON::XS v3.0 or later is installed. * + * * + * JSON::true and JSON::false returned JSON::Boolean objects. * + * For workaround, they return JSON::PP::Boolean objects in this version. * + * * + * isa_ok(JSON::true, 'JSON::PP::Boolean'); * + * * + * And it discards a feature: * + * * + * ok(JSON::true eq 'true'); * + * * + * In other word, JSON::PP::Boolean overload numeric only. * + * * + * ok( JSON::true == 1 ); * + * * + ************************************************************************** + + ************************** CAUTION ************************** * This is 'JSON version 2' and there are many differences * * to version 1.xx * diff -Nru libjson-perl-2.61/META.json libjson-perl-2.90/META.json --- libjson-perl-2.61/META.json 2013-10-17 11:02:49.000000000 +0000 +++ libjson-perl-2.90/META.json 2013-10-31 10:38:21.000000000 +0000 @@ -45,5 +45,5 @@ "url" : "https://github.com/makamaka/JSON" } }, - "version" : "2.61" + "version" : "2.90" } diff -Nru libjson-perl-2.61/META.yml libjson-perl-2.90/META.yml --- libjson-perl-2.61/META.yml 2013-10-17 11:02:48.000000000 +0000 +++ libjson-perl-2.90/META.yml 2013-10-31 10:38:21.000000000 +0000 @@ -23,4 +23,4 @@ Test::More: 0 resources: repository: https://github.com/makamaka/JSON -version: 2.61 +version: 2.90 diff -Nru libjson-perl-2.61/README libjson-perl-2.90/README --- libjson-perl-2.61/README 2013-10-17 10:54:18.000000000 +0000 +++ libjson-perl-2.90/README 2013-10-31 10:36:05.000000000 +0000 @@ -64,9 +64,10 @@ # recommend to use (en|de)code_json. VERSION - 2.58 + 2.90 - This version is compatible with JSON::XS 2.27 and later. + This version is compatible with JSON::XS 2.34 and later. + (Not yet compatble to JSON::XS B<3.0x>.) NOTE JSON::PP was earlier included in the "JSON" distribution, but has since @@ -82,6 +83,31 @@ backwards computability. JSON.pm should thus work as it did before. DESCRIPTION + *************************** CAUTION ************************************** + * * + * INCOMPATIBLE CHANGE (JSON::XS version 2.90) * + * * + * JSON.pm had patched JSON::XS::Boolean and JSON::PP::Boolean internally * + * on loading time for making these modules inherit JSON::Boolean. * + * But since JSON::XS v3.0 it use Types::Serialiser as boolean class. * + * Then now JSON.pm breaks boolean classe overload features and * + * -support_by_pp if JSON::XS v3.0 or later is installed. * + * * + * JSON::true and JSON::false returned JSON::Boolean objects. * + * For workaround, they return JSON::PP::Boolean objects in this version. * + * * + * isa_ok(JSON::true, 'JSON::PP::Boolean'); * + * * + * And it discards a feature: * + * * + * ok(JSON::true eq 'true'); * + * * + * In other word, JSON::PP::Boolean overload numeric only. * + * * + * ok( JSON::true == 1 ); * + * * + ************************************************************************** + ************************** CAUTION ******************************** * This is 'JSON module version 2' and there are many differences * * to version 1.xx * @@ -1146,15 +1172,9 @@ numbers 1 and 0. You can check whether a scalar is a JSON boolean by using the "JSON::is_bool" function. - If "JSON::true" and "JSON::false" are used as strings or compared as - strings, they represent as "true" and "false" respectively. - - print JSON::true . "\n"; - => true print JSON::true + 1; => 1 - ok(JSON::true eq 'true'); ok(JSON::true eq '1'); ok(JSON::true == 1); diff -Nru libjson-perl-2.61/t/e02_bool.t libjson-perl-2.90/t/e02_bool.t --- libjson-perl-2.61/t/e02_bool.t 2011-10-26 02:10:15.000000000 +0000 +++ libjson-perl-2.90/t/e02_bool.t 2013-10-31 10:36:05.000000000 +0000 @@ -1,33 +1,34 @@ -#!/usr/bin/perl -w - -use strict; - -use Test::More; -use strict; - -BEGIN { plan tests => 11 }; - -BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; } - -use JSON; - -my $json = new JSON; - - -is($json->encode([!1]), '[""]'); -is($json->encode([!!2]), '["1"]'); - -is($json->encode([ 'a' eq 'b' ]), '[""]'); -is($json->encode([ 'a' eq 'a' ]), '["1"]'); - -is($json->encode([ ('a' eq 'b') + 1 ]), '[1]'); -is($json->encode([ ('a' eq 'a') + 1 ]), '[2]'); - -ok(JSON::true eq 'true'); -ok(JSON::true eq '1'); -ok(JSON::true == 1); -isa_ok(JSON::true, JSON->backend . '::Boolean'); -isa_ok(JSON::true, 'JSON::Boolean'); - - - +#!/usr/bin/perl -w + +use strict; + +use Test::More; +use strict; + +BEGIN { plan tests => 8 }; + +BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; } + +use JSON; + +my $json = new JSON; + + +is($json->encode([!1]), '[""]'); +is($json->encode([!!2]), '["1"]'); + +is($json->encode([ 'a' eq 'b' ]), '[""]'); +is($json->encode([ 'a' eq 'a' ]), '["1"]'); + +is($json->encode([ ('a' eq 'b') + 1 ]), '[1]'); +is($json->encode([ ('a' eq 'a') + 1 ]), '[2]'); + +# discard overload hack for JSON::XS 3.0 boolean class +#ok(JSON::true eq 'true'); +#ok(JSON::true eq '1'); +ok(JSON::true == 1); +isa_ok(JSON::true, 'JSON::PP::Boolean'); +#isa_ok(JSON::true, 'JSON::Boolean'); + + + diff -Nru libjson-perl-2.61/t/e03_bool2.t libjson-perl-2.90/t/e03_bool2.t --- libjson-perl-2.61/t/e03_bool2.t 2011-10-26 02:10:15.000000000 +0000 +++ libjson-perl-2.90/t/e03_bool2.t 2013-10-31 10:36:05.000000000 +0000 @@ -1,6 +1,6 @@ use Test::More; -BEGIN { plan tests => 26 }; +BEGIN { plan tests => 16 }; BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; } use JSON; @@ -11,30 +11,30 @@ my $jsontext = q|[true,false,null]|; my $obj = from_json($jsontext); - -isa_ok($obj->[0], 'JSON::Boolean'); -isa_ok($obj->[1], 'JSON::Boolean'); +#push @JSON::backportPP::Boolean::ISA, 'JSON::Boolean'; +isa_ok($obj->[0], 'JSON::PP::Boolean'); +isa_ok($obj->[1], 'JSON::PP::Boolean'); ok(!defined $obj->[2], 'null is undef'); ok($obj->[0] == 1); ok($obj->[0] != 0); ok($obj->[1] == 0); ok($obj->[1] != 1); - -ok($obj->[0] eq 'true', 'eq true'); -ok($obj->[0] ne 'false', 'ne false'); -ok($obj->[1] eq 'false', 'eq false'); -ok($obj->[1] ne 'true', 'ne true'); +# discard overload hack for JSON::XS 3.0 boolean class +#ok($obj->[0] eq 'true', 'eq true'); +#ok($obj->[0] ne 'false', 'ne false'); +#ok($obj->[1] eq 'false', 'eq false'); +#ok($obj->[1] ne 'true', 'ne true'); ok($obj->[0] eq $obj->[0]); ok($obj->[0] ne $obj->[1]); -ok(JSON::true eq 'true'); -ok(JSON::true ne 'false'); -ok(JSON::true ne 'null'); -ok(JSON::false eq 'false'); -ok(JSON::false ne 'true'); -ok(JSON::false ne 'null'); +#ok(JSON::true eq 'true'); +#ok(JSON::true ne 'false'); +#ok(JSON::true ne 'null'); +#ok(JSON::false eq 'false'); +#ok(JSON::false ne 'true'); +#ok(JSON::false ne 'null'); ok(!defined JSON::null); is(from_json('[true]' )->[0], JSON::true); diff -Nru libjson-perl-2.61/t/x00_load.t libjson-perl-2.90/t/x00_load.t --- libjson-perl-2.61/t/x00_load.t 2013-10-17 10:54:18.000000000 +0000 +++ libjson-perl-2.90/t/x00_load.t 2013-10-31 10:36:05.000000000 +0000 @@ -9,6 +9,7 @@ SKIP: { skip "can't use JSON::XS.", 1, unless( JSON->backend->is_xs ); - ok(1, "load JSON::XS"); + diag("load JSON::XS v." . JSON->backend->VERSION ); + ok(1, "load JSON::XS v." . JSON->backend->VERSION ); } diff -Nru libjson-perl-2.61/t/x17_strange_overload.t libjson-perl-2.90/t/x17_strange_overload.t --- libjson-perl-2.61/t/x17_strange_overload.t 2013-04-06 06:34:12.000000000 +0000 +++ libjson-perl-2.90/t/x17_strange_overload.t 2013-10-31 10:36:05.000000000 +0000 @@ -5,6 +5,8 @@ BEGIN { $ENV{PERL_JSON_BACKEND} = 1; } SKIP: { + skip "for JSON::XS 3.x. cimpatible. Please see to Changes.", 2; + eval q{ use JSON::XS; use JSON (); diff -Nru libjson-perl-2.61/t/xe02_bool.t libjson-perl-2.90/t/xe02_bool.t --- libjson-perl-2.61/t/xe02_bool.t 2011-10-26 02:10:15.000000000 +0000 +++ libjson-perl-2.90/t/xe02_bool.t 2013-10-31 10:36:05.000000000 +0000 @@ -1,34 +1,34 @@ -#!/usr/bin/perl -w - -use strict; - -use Test::More; -use strict; - -BEGIN { plan tests => 11 }; - -BEGIN { $ENV{PERL_JSON_BACKEND} = 1; } - -use JSON; - -SKIP: { - skip "can't use JSON::XS.", 11, unless( JSON->backend->is_xs ); - -my $json = new JSON; - -is($json->encode([!1]), '[""]'); -is($json->encode([!!2]), '["1"]'); - -is($json->encode([ 'a' eq 'b' ]), '[""]'); -is($json->encode([ 'a' eq 'a' ]), '["1"]'); - -is($json->encode([ ('a' eq 'b') + 1 ]), '[1]'); -is($json->encode([ ('a' eq 'a') + 1 ]), '[2]'); - -ok(JSON::true eq 'true'); -ok(JSON::true eq '1'); -ok(JSON::true == 1); -isa_ok(JSON::true, JSON->backend . '::Boolean'); -isa_ok(JSON::true, 'JSON::Boolean'); - -} +#!/usr/bin/perl -w + +use strict; + +use Test::More; +use strict; + +BEGIN { plan tests => 8 }; + +BEGIN { $ENV{PERL_JSON_BACKEND} = 1; } + +use JSON; + +SKIP: { + skip "can't use JSON::XS.", 8, unless( JSON->backend->is_xs ); + +my $json = new JSON; + +is($json->encode([!1]), '[""]'); +is($json->encode([!!2]), '["1"]'); + +is($json->encode([ 'a' eq 'b' ]), '[""]'); +is($json->encode([ 'a' eq 'a' ]), '["1"]'); + +is($json->encode([ ('a' eq 'b') + 1 ]), '[1]'); +is($json->encode([ ('a' eq 'a') + 1 ]), '[2]'); + +# discard overload hack for JSON::XS 3.0 boolean class +#ok(JSON::true eq 'true'); +#ok(JSON::true eq '1'); +ok(JSON::true == 1); +isa_ok(JSON::true, 'JSON::PP::Boolean'); + +} diff -Nru libjson-perl-2.61/t/xe03_bool2.t libjson-perl-2.90/t/xe03_bool2.t --- libjson-perl-2.61/t/xe03_bool2.t 2011-10-26 02:10:15.000000000 +0000 +++ libjson-perl-2.90/t/xe03_bool2.t 2013-10-31 10:36:05.000000000 +0000 @@ -1,12 +1,12 @@ use Test::More; -BEGIN { plan tests => 26 }; +BEGIN { plan tests => 16 }; BEGIN { $ENV{PERL_JSON_BACKEND} = 1; } use JSON; SKIP: { - skip "can't use JSON::XS.", 26, unless( JSON->backend->is_xs ); + skip "can't use JSON::XS.", 16, unless( JSON->backend->is_xs ); is(to_json([JSON::true]), q|[true]|); is(to_json([JSON::false]), q|[false]|); @@ -15,8 +15,8 @@ my $jsontext = q|[true,false,null]|; my $obj = from_json($jsontext); -isa_ok($obj->[0], 'JSON::Boolean'); -isa_ok($obj->[1], 'JSON::Boolean'); +isa_ok($obj->[0], 'JSON::PP::Boolean'); +isa_ok($obj->[1], 'JSON::PP::Boolean'); ok(!defined $obj->[2], 'null is undef'); ok($obj->[0] == 1); @@ -24,20 +24,20 @@ ok($obj->[1] == 0); ok($obj->[1] != 1); -ok($obj->[0] eq 'true', 'eq true'); -ok($obj->[0] ne 'false', 'ne false'); -ok($obj->[1] eq 'false', 'eq false'); -ok($obj->[1] ne 'true', 'ne true'); +#ok($obj->[0] eq 'true', 'eq true'); +#ok($obj->[0] ne 'false', 'ne false'); +#ok($obj->[1] eq 'false', 'eq false'); +#ok($obj->[1] ne 'true', 'ne true'); ok($obj->[0] eq $obj->[0]); ok($obj->[0] ne $obj->[1]); -ok(JSON::true eq 'true'); -ok(JSON::true ne 'false'); -ok(JSON::true ne 'null'); -ok(JSON::false eq 'false'); -ok(JSON::false ne 'true'); -ok(JSON::false ne 'null'); +#ok(JSON::true eq 'true'); +#ok(JSON::true ne 'false'); +#ok(JSON::true ne 'null'); +#ok(JSON::false eq 'false'); +#ok(JSON::false ne 'true'); +#ok(JSON::false ne 'null'); ok(!defined JSON::null); is(from_json('[true]' )->[0], JSON::true); diff -Nru libjson-perl-2.61/t/xe12_boolean.t libjson-perl-2.90/t/xe12_boolean.t --- libjson-perl-2.61/t/xe12_boolean.t 2011-10-26 02:10:15.000000000 +0000 +++ libjson-perl-2.90/t/xe12_boolean.t 2013-10-31 10:36:05.000000000 +0000 @@ -21,13 +21,13 @@ my $bool = $json->allow_nonref->decode('true'); # it's normal -isa_ok( $bool, 'JSON::Boolean' ); +isa_ok( $bool, 'JSON::PP::Boolean' ); is( $json->encode([ JSON::true ]), '[true]' ); # make XS non support flag enable! $bool = $json->allow_singlequote->decode('true'); -isa_ok( $bool, 'JSON::Boolean' ); +isa_ok( $bool, 'JSON::PP::Boolean' ); is( $json->encode([ JSON::true ]), '[true]' ); }