Hello community, here is the log from the commit of package perl-JSON for openSUSE:Factory checked in at 2013-11-28 18:52:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-JSON (Old) and /work/SRC/openSUSE:Factory/.perl-JSON.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-JSON" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-JSON/perl-JSON.changes 2013-06-13 17:42:45.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-JSON.new/perl-JSON.changes 2013-11-28 18:52:12.000000000 +0100 @@ -1,0 +2,27 @@ +Tue Nov 26 07:28:28 UTC 2013 - [email protected] + +- updated to 2.90 + +CAUTION!!! + INCOMPATIBLE CHANGE + + 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 ); + +------------------------------------------------------------------- Old: ---- JSON-2.59.tar.gz New: ---- JSON-2.90.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-JSON.spec ++++++ --- /var/tmp/diff_new_pack.WLiqm6/_old 2013-11-28 18:52:13.000000000 +0100 +++ /var/tmp/diff_new_pack.WLiqm6/_new 2013-11-28 18:52:13.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-JSON -Version: 2.59 +Version: 2.90 Release: 0 %define cpan_name JSON Summary: JSON (JavaScript Object Notation) encoder/decoder @@ -29,10 +29,41 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros +#BuildRequires: perl(JSON) +#BuildRequires: perl(JSON::backportPP) +#BuildRequires: perl(JSON::PP) +#BuildRequires: perl(JSON::XS) +#BuildRequires: perl(Tie::IxHash) +#BuildRequires: perl(_unicode_handling) Recommends: perl(JSON::XS) >= 2.34 %{perl_requires} %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 * ++++++ JSON-2.59.tar.gz -> JSON-2.90.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/Changes new/JSON-2.90/Changes --- old/JSON-2.59/Changes 2013-06-05 08:04:55.000000000 +0200 +++ new/JSON-2.90/Changes 2013-10-31 11:36:05.000000000 +0100 @@ -1,18 +1,61 @@ 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 + https://rt.cpan.org/Public/Bug/Display.html?id=86948 + +2.60 + - $json->is_xs, $json->is_pp was completely broken. + pointed by rt#75867 and emceelam + 2.59 Wed Jun 5 14:35:54 2013 - PUREPERL_ONLY support was not supported... and finally remove all PP options from Makefile.PL. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/MANIFEST new/JSON-2.90/MANIFEST --- old/JSON-2.59/MANIFEST 2013-06-05 08:33:14.000000000 +0200 +++ new/JSON-2.90/MANIFEST 2013-10-31 11:38:22.000000000 +0100 @@ -68,4 +68,5 @@ t/xe12_boolean.t t/xe19_xs_and_suportbypp.t t/xe20_croak_message.t +t/xe21_is_pp.t META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/META.json new/JSON-2.90/META.json --- old/JSON-2.59/META.json 2013-06-05 08:33:14.000000000 +0200 +++ new/JSON-2.90/META.json 2013-10-31 11:38:21.000000000 +0100 @@ -45,5 +45,5 @@ "url" : "https://github.com/makamaka/JSON" } }, - "version" : "2.59" + "version" : "2.90" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/META.yml new/JSON-2.90/META.yml --- old/JSON-2.59/META.yml 2013-06-05 08:33:14.000000000 +0200 +++ new/JSON-2.90/META.yml 2013-10-31 11:38:21.000000000 +0100 @@ -23,4 +23,4 @@ Test::More: 0 resources: repository: https://github.com/makamaka/JSON -version: 2.59 +version: 2.90 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/Makefile.PL new/JSON-2.90/Makefile.PL --- old/JSON-2.59/Makefile.PL 2013-06-05 07:50:29.000000000 +0200 +++ new/JSON-2.90/Makefile.PL 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/README new/JSON-2.90/README --- old/JSON-2.59/README 2013-06-05 07:50:29.000000000 +0200 +++ new/JSON-2.90/README 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/lib/JSON/backportPP.pm new/JSON-2.90/lib/JSON/backportPP.pm --- old/JSON-2.59/lib/JSON/backportPP.pm 2013-05-23 06:37:21.000000000 +0200 +++ new/JSON-2.90/lib/JSON/backportPP.pm 2013-10-31 11:36:05.000000000 +0100 @@ -13,7 +13,7 @@ #use Devel::Peek; use vars qw($VERSION); -$VERSION = '2.27202'; +$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 @@ -1570,7 +1573,7 @@ $self->{incr_text} = substr( $self->{incr_text}, $p ); $self->{incr_p} = 0; - return $obj or ''; + return $obj || ''; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/lib/JSON.pm new/JSON-2.90/lib/JSON.pm --- old/JSON-2.59/lib/JSON.pm 2013-06-05 07:50:29.000000000 +0200 +++ new/JSON-2.90/lib/JSON.pm 2013-10-31 11:36:05.000000000 +0100 @@ -7,7 +7,7 @@ @JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json); BEGIN { - $JSON::VERSION = '2.59'; + $JSON::VERSION = '2.90'; $JSON::DEBUG = 0 unless (defined $JSON::DEBUG); $JSON::DEBUG = $ENV{ PERL_JSON_DEBUG } if exists $ENV{ PERL_JSON_DEBUG }; } @@ -15,7 +15,7 @@ my $Module_XS = 'JSON::XS'; my $Module_PP = 'JSON::PP'; my $Module_bp = 'JSON::backportPP'; # included in JSON distribution -my $PP_Version = '2.27200'; +my $PP_Version = '2.27203'; my $XS_Version = '2.34'; @@ -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 } @@ -190,12 +191,12 @@ sub is_xs { - return $_[0]->module eq $Module_XS; + return $_[0]->backend eq $Module_XS; } sub is_pp { - return not $_[0]->xs; + return not $_[0]->is_xs; } @@ -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<JSON::is_bool> function. -If C<JSON::true> and C<JSON::false> are used as strings or compared as strings, -they represent as C<true> and C<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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/e02_bool.t new/JSON-2.90/t/e02_bool.t --- old/JSON-2.59/t/e02_bool.t 2011-10-26 04:10:15.000000000 +0200 +++ new/JSON-2.90/t/e02_bool.t 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/e03_bool2.t new/JSON-2.90/t/e03_bool2.t --- old/JSON-2.59/t/e03_bool2.t 2011-10-26 04:10:15.000000000 +0200 +++ new/JSON-2.90/t/e03_bool2.t 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/x00_load.t new/JSON-2.90/t/x00_load.t --- old/JSON-2.59/t/x00_load.t 2011-10-26 04:10:15.000000000 +0200 +++ new/JSON-2.90/t/x00_load.t 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/x17_strange_overload.t new/JSON-2.90/t/x17_strange_overload.t --- old/JSON-2.59/t/x17_strange_overload.t 2013-04-06 08:34:12.000000000 +0200 +++ new/JSON-2.90/t/x17_strange_overload.t 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/xe02_bool.t new/JSON-2.90/t/xe02_bool.t --- old/JSON-2.59/t/xe02_bool.t 2011-10-26 04:10:15.000000000 +0200 +++ new/JSON-2.90/t/xe02_bool.t 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/xe03_bool2.t new/JSON-2.90/t/xe03_bool2.t --- old/JSON-2.59/t/xe03_bool2.t 2011-10-26 04:10:15.000000000 +0200 +++ new/JSON-2.90/t/xe03_bool2.t 2013-10-31 11:36:05.000000000 +0100 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/xe12_boolean.t new/JSON-2.90/t/xe12_boolean.t --- old/JSON-2.59/t/xe12_boolean.t 2011-10-26 04:10:15.000000000 +0200 +++ new/JSON-2.90/t/xe12_boolean.t 2013-10-31 11:36:05.000000000 +0100 @@ -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]' ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-2.59/t/xe21_is_pp.t new/JSON-2.90/t/xe21_is_pp.t --- old/JSON-2.59/t/xe21_is_pp.t 1970-01-01 01:00:00.000000000 +0100 +++ new/JSON-2.90/t/xe21_is_pp.t 2013-06-06 05:05:26.000000000 +0200 @@ -0,0 +1,30 @@ +#!/usr/bin/perl -w + +use strict; +use Test::More; + +BEGIN { plan tests => 5 }; + +BEGIN { + $ENV{PERL_JSON_BACKEND} = 1; +} + +use JSON; + +my $json = JSON->new(); + +ok( $json->backend, 'backend is ' . $json->backend ); + +if ( $json->backend->is_xs ) { + ok (!JSON->is_pp(), 'JSON->is_pp()'); + ok ( JSON->is_xs(), 'JSON->is_xs()'); + ok (!$json->is_pp(), '$json->is_pp()'); + ok ( $json->is_xs(), '$json->is_xs()'); +} +else { + ok ( JSON->is_pp(), 'JSON->is_pp()'); + ok (!JSON->is_xs(), 'JSON->is_xs()'); + ok ( $json->is_pp(), '$json->is_pp()'); + ok (!$json->is_xs(), '$json->is_xs()'); +} + -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
