From: gregor herrmann Date: Mon, 4 Aug 2014 22:28:26 +0000 (+0200) Subject: Imported Upstream version 3.001.007 X-Git-Tag: archive/raspbian/4.017+ds-1+rpi1~1^2~3^2~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0c91bdbd892014cd7b47de5395a2e35ac0af3f7a;p=libsereal-encoder-perl.git Imported Upstream version 3.001.007 --- diff --git a/MANIFEST b/MANIFEST index 595d9d2..c976cbd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -35,8 +35,8 @@ srl_inline.h srl_protocol.h t/001_load.t t/002_constants.t -t/002_testset.t t/003_ptable.t +t/004_testset.t t/010_desperate.t t/011_aliased_dedupe.t t/020_sort_keys.t diff --git a/META.json b/META.json index 042b86d..5cb0a60 100644 --- a/META.json +++ b/META.json @@ -55,5 +55,5 @@ "url" : "git://github.com/Sereal/Sereal.git" } }, - "version" : "3.001_006" + "version" : "3.001_007" } diff --git a/META.yml b/META.yml index 8b59bce..e92ef75 100644 --- a/META.yml +++ b/META.yml @@ -32,4 +32,4 @@ requires: resources: bugtracker: https://github.com/Sereal/Sereal/issues repository: git://github.com/Sereal/Sereal.git -version: 3.001_006 +version: 3.001_007 diff --git a/lib/Sereal/Encoder.pm b/lib/Sereal/Encoder.pm index 36f7e6d..c7b1e4e 100644 --- a/lib/Sereal/Encoder.pm +++ b/lib/Sereal/Encoder.pm @@ -5,7 +5,7 @@ use warnings; use Carp qw/croak/; use XSLoader; -our $VERSION = '3.001_006'; # Don't forget to update the TestCompat set for testing against installed decoders! +our $VERSION = '3.001_007'; # Don't forget to update the TestCompat set for testing against installed decoders! our $XS_VERSION = $VERSION; $VERSION= eval $VERSION; # not for public consumption, just for testing. @@ -236,11 +236,26 @@ do so. Do note that the setting is somewhat approximate. Setting it to 10000 may break at somewhere between 9997 and 10003 nested structures depending on their types. +=head3 canoncial + +Enable all options which are related to producing canonical output, so that +two strucutures with similar contents produce the same serialized form. + +See the caveats elsewhere in this document about producing canonical output. + +Currently sets the default for the following parameters: C +and C. If the option is explicitly set then this setting is ignored. +More options may be added in the future. + +You are warned that use of this option may incur additional performance penalties +in a future release by enabling other options than those listed here. + =head3 canonical_refs Normally C will ARRAYREF and HASHREF tags when the item contains less than 16 items, and and is not referenced more than once. This flag will -override this optimization and use a standard REFN ARRAY style tag output. +override this optimization and use a standard REFN ARRAY style tag output. This +is primarily useful for producing canoncial output and for testing Sereal itself. =head3 sort_keys diff --git a/t/002_testset.t b/t/002_testset.t deleted file mode 100644 index 25b8fa6..0000000 --- a/t/002_testset.t +++ /dev/null @@ -1,32 +0,0 @@ -#!perl -use strict; -use warnings; -use Sereal::Decoder; -use Data::Dumper; -use File::Spec; - -# test our test framework - -use lib File::Spec->catdir(qw(t lib)); -BEGIN { - lib->import('lib') - if !-d 't'; -} - -use Sereal::TestSet qw(:all); -use Test::More; -# needs more tests -ok(_deep_cmp(["x"],{})); -ok(_deep_cmp({"x"=>1},{"y"=>1})); -ok(_deep_cmp({"x"=>1},{"x"=>2})); -ok(_deep_cmp({"x"=>1},{"x"=>2,"y"=>1})); -ok(!_deep_cmp({"x"=>1},{"x"=>1})); -ok(!_deep_cmp(["x"],["x"])); -ok(_deep_cmp(["x"],["y","p"])); -ok(_deep_cmp(["a","x"],["y"])); -ok(_test_str("test","foo","bar")); -ok(!_test_str("test","aaa","aaa")); - -pass(); -done_testing(); - diff --git a/t/004_testset.t b/t/004_testset.t new file mode 100644 index 0000000..20719c3 --- /dev/null +++ b/t/004_testset.t @@ -0,0 +1,36 @@ +#!perl +use strict; +use warnings; +use Data::Dumper; +use File::Spec; + +# test our test framework + +use lib File::Spec->catdir(qw(t lib)); +BEGIN { + lib->import('lib') + if !-d 't'; +} + +use Sereal::TestSet qw(:all); +use Test::More; + +# needs more tests +ok(_deep_cmp(["x"],{})); +ok(_deep_cmp({"x"=>1},{"y"=>1})); +ok(_deep_cmp({"x"=>1},{"x"=>2})); +ok(_deep_cmp({"x"=>1},{"x"=>2,"y"=>1})); +ok(!_deep_cmp({"x"=>1},{"x"=>1})); +ok(!_deep_cmp(["x"],["x"])); +ok(_deep_cmp(["x"],["y","p"])); +ok(_deep_cmp(["a","x"],["y"])); +ok(_cmp_str("foo","bar")); +ok(!_cmp_str("aaa","aaa")); +ok(_cmp_str("aaacowbbb","aaadogbb")); +my $l= "ba\xDF"; +my $u= $l; +utf8::upgrade($u); +ok(_cmp_str($l,$u)); +pass(); +done_testing(); + diff --git a/t/700_roundtrip/v1/plain.t b/t/700_roundtrip/v1/plain.t index 49f7e03..5f272a4 100644 --- a/t/700_roundtrip/v1/plain.t +++ b/t/700_roundtrip/v1/plain.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v1/plain_canon.t b/t/700_roundtrip/v1/plain_canon.t index 5f95299..00cbb89 100644 --- a/t/700_roundtrip/v1/plain_canon.t +++ b/t/700_roundtrip/v1/plain_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v1/snappy.t b/t/700_roundtrip/v1/snappy.t index a9735e0..02ed97b 100644 --- a/t/700_roundtrip/v1/snappy.t +++ b/t/700_roundtrip/v1/snappy.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v1/snappy_canon.t b/t/700_roundtrip/v1/snappy_canon.t index 9b8deb5..acb9611 100644 --- a/t/700_roundtrip/v1/snappy_canon.t +++ b/t/700_roundtrip/v1/snappy_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/dedudep_strings.t b/t/700_roundtrip/v2/dedudep_strings.t index 41473a6..f0590bd 100644 --- a/t/700_roundtrip/v2/dedudep_strings.t +++ b/t/700_roundtrip/v2/dedudep_strings.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/freeze_thaw.t b/t/700_roundtrip/v2/freeze_thaw.t index 35913aa..4efd5d0 100644 --- a/t/700_roundtrip/v2/freeze_thaw.t +++ b/t/700_roundtrip/v2/freeze_thaw.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/plain.t b/t/700_roundtrip/v2/plain.t index 49f7e03..5f272a4 100644 --- a/t/700_roundtrip/v2/plain.t +++ b/t/700_roundtrip/v2/plain.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/plain_canon.t b/t/700_roundtrip/v2/plain_canon.t index 5f95299..00cbb89 100644 --- a/t/700_roundtrip/v2/plain_canon.t +++ b/t/700_roundtrip/v2/plain_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/readonly.t b/t/700_roundtrip/v2/readonly.t index 08a2916..238fc8e 100644 --- a/t/700_roundtrip/v2/readonly.t +++ b/t/700_roundtrip/v2/readonly.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/snappy.t b/t/700_roundtrip/v2/snappy.t index a9735e0..02ed97b 100644 --- a/t/700_roundtrip/v2/snappy.t +++ b/t/700_roundtrip/v2/snappy.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/snappy_canon.t b/t/700_roundtrip/v2/snappy_canon.t index 9b8deb5..acb9611 100644 --- a/t/700_roundtrip/v2/snappy_canon.t +++ b/t/700_roundtrip/v2/snappy_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/snappy_incr.t b/t/700_roundtrip/v2/snappy_incr.t index ddd4bb9..54c6485 100644 --- a/t/700_roundtrip/v2/snappy_incr.t +++ b/t/700_roundtrip/v2/snappy_incr.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/snappy_incr_canon.t b/t/700_roundtrip/v2/snappy_incr_canon.t index dd1d622..6d5f4f9 100644 --- a/t/700_roundtrip/v2/snappy_incr_canon.t +++ b/t/700_roundtrip/v2/snappy_incr_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v2/sort_keys.t b/t/700_roundtrip/v2/sort_keys.t index 61f5439..a31789e 100644 --- a/t/700_roundtrip/v2/sort_keys.t +++ b/t/700_roundtrip/v2/sort_keys.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/dedudep_strings.t b/t/700_roundtrip/v3/dedudep_strings.t index 41473a6..f0590bd 100644 --- a/t/700_roundtrip/v3/dedudep_strings.t +++ b/t/700_roundtrip/v3/dedudep_strings.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/freeze_thaw.t b/t/700_roundtrip/v3/freeze_thaw.t index 35913aa..4efd5d0 100644 --- a/t/700_roundtrip/v3/freeze_thaw.t +++ b/t/700_roundtrip/v3/freeze_thaw.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/plain.t b/t/700_roundtrip/v3/plain.t index 49f7e03..5f272a4 100644 --- a/t/700_roundtrip/v3/plain.t +++ b/t/700_roundtrip/v3/plain.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/plain_canon.t b/t/700_roundtrip/v3/plain_canon.t index 5f95299..00cbb89 100644 --- a/t/700_roundtrip/v3/plain_canon.t +++ b/t/700_roundtrip/v3/plain_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/readonly.t b/t/700_roundtrip/v3/readonly.t index 08a2916..238fc8e 100644 --- a/t/700_roundtrip/v3/readonly.t +++ b/t/700_roundtrip/v3/readonly.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/snappy.t b/t/700_roundtrip/v3/snappy.t index a9735e0..02ed97b 100644 --- a/t/700_roundtrip/v3/snappy.t +++ b/t/700_roundtrip/v3/snappy.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/snappy_canon.t b/t/700_roundtrip/v3/snappy_canon.t index 9b8deb5..acb9611 100644 --- a/t/700_roundtrip/v3/snappy_canon.t +++ b/t/700_roundtrip/v3/snappy_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/snappy_incr.t b/t/700_roundtrip/v3/snappy_incr.t index ddd4bb9..54c6485 100644 --- a/t/700_roundtrip/v3/snappy_incr.t +++ b/t/700_roundtrip/v3/snappy_incr.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/snappy_incr_canon.t b/t/700_roundtrip/v3/snappy_incr_canon.t index dd1d622..6d5f4f9 100644 --- a/t/700_roundtrip/v3/snappy_incr_canon.t +++ b/t/700_roundtrip/v3/snappy_incr_canon.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/sort_keys.t b/t/700_roundtrip/v3/sort_keys.t index 61f5439..a31789e 100644 --- a/t/700_roundtrip/v3/sort_keys.t +++ b/t/700_roundtrip/v3/sort_keys.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/zlib.t b/t/700_roundtrip/v3/zlib.t index b541a46..1f082b7 100644 --- a/t/700_roundtrip/v3/zlib.t +++ b/t/700_roundtrip/v3/zlib.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/700_roundtrip/v3/zlib_force.t b/t/700_roundtrip/v3/zlib_force.t index 3764001..ec77263 100644 --- a/t/700_roundtrip/v3/zlib_force.t +++ b/t/700_roundtrip/v3/zlib_force.t @@ -1,7 +1,6 @@ #!perl use strict; use warnings; -use Sereal::Decoder; use Data::Dumper; use File::Spec; diff --git a/t/lib/Sereal/TestSet.pm b/t/lib/Sereal/TestSet.pm index 726ac71..7946298 100644 --- a/t/lib/Sereal/TestSet.pm +++ b/t/lib/Sereal/TestSet.pm @@ -12,17 +12,18 @@ use Test::LongString; use Devel::Peek; use Encode qw(encode_utf8 is_utf8); use Scalar::Util qw(reftype blessed refaddr); +use Data::Dumper; # Dynamically load constants from whatever is being tested our ($Class, $ConstClass); BEGIN { - if (defined $INC{"Sereal/Encoder.pm"} - and $INC{"Sereal/Encoder.pm"} =~ /\bblib\b/) - { + if (-e "lib/Sereal/Encoder") { $Class = 'Sereal::Encoder'; } - else { + elsif (-e "lib/Sereal/Decoder") { $Class = 'Sereal::Decoder'; + } else { + die "Could not find an applicable Sereal constants location"; } $ConstClass = $Class . "::Constants"; eval "use $ConstClass ':all'; 1" @@ -48,7 +49,7 @@ our @EXPORT_OK = qw( setup_tests _deep_cmp _test - _test_str + _cmp_str ); our %EXPORT_TAGS = (all => \@EXPORT_OK); @@ -771,15 +772,17 @@ sub _test { if ($v1 ne $v2) { my $q1= Data::Dumper::qquote($v1); my $q2= Data::Dumper::qquote($v2); - return "msg: $q1 ne $q2" + return "$msg: $q1 ne $q2" } return; } -sub _test_str { - my ($msg, $v1, $v2)= @_; - if (is_utf8($v1) != is_utf8($v2)) { - return "$msg: utf8 flag mismatch"; - } +sub _cmp_str { + my ($v1, $v2)= @_; + my $v1_is_utf8= is_utf8($v1); + my $v2_is_utf8= is_utf8($v2); + + Encode::_utf8_off($v1); # turn off utf8, in case it is corrupt + Encode::_utf8_off($v2); # turn off utf8, in case it is corrupt if ($v1 eq $v2) { return; } @@ -787,43 +790,67 @@ sub _test_str { $diff_start++ while $diff_start < length($v1) and $diff_start < length($v2) and substr($v1, $diff_start,1) eq substr($v2, $diff_start,1); - my $diff_end= $diff_start; - $diff_end++ while $diff_end < length($v1) - and $diff_end < length($v2) - and substr($v1, $diff_end,1) ne substr($v2, $diff_end,1); + my $diff_end= length($v1) < length($v2) ? length($v1) : length($v2); + $diff_end-- if $diff_end; + + $diff_end-- while $diff_end > $diff_start + and $diff_end > $diff_start + and substr($v1, $diff_end-1,1) eq substr($v2, $diff_end-1,1); my $length_to_show= $diff_end - $diff_start; - $length_to_show= 30 if $length_to_show > 30; + + my $max_context_len= 10; + my $max_diff_len= 30; + + $length_to_show= $max_diff_len if $length_to_show > $max_diff_len; + my $q1= Data::Dumper::qquote(substr($v1, $diff_start, $length_to_show )); my $q2= Data::Dumper::qquote(substr($v2, $diff_start, $length_to_show )); - my $context_start= $diff_start > 10 ? $diff_start - 10 : 0; + my $context_start= $diff_start > $max_context_len ? $diff_start - $max_context_len : 0; if ($context_start < $diff_start) { - $q1 = Data::Dumper::qquote(substr($v1,$context_start,10)) . " . " . $q1; - $q2 = Data::Dumper::qquote(substr($v2,$context_start,10)) . " . " . $q2; + $q1 = Data::Dumper::qquote(substr($v1,$context_start, $diff_start - $context_start)) . " . " . $q1; + $q2 = Data::Dumper::qquote(substr($v2,$context_start, $diff_start - $context_start)) . " . " . $q2; } + if ($context_start > 0) { $q1 = "...$q1"; $q2 = "...$q2"; } - if ($length_to_show < 30) { - $q1 .= " . " . Data::Dumper::qquote(substr($v1, $diff_start + $length_to_show, 30-$length_to_show)); - $q2 .= " . " . Data::Dumper::qquote(substr($v2, $diff_start + $length_to_show, 30-$length_to_show)); + if ($length_to_show < $max_diff_len) { + $q1 .= " . " . Data::Dumper::qquote(substr($v1, $diff_start + $length_to_show, $max_diff_len - $length_to_show)) + if $diff_start + $length_to_show < length($v1); + $q2 .= " . " . Data::Dumper::qquote(substr($v2, $diff_start + $length_to_show, $max_diff_len - $length_to_show)) + if $diff_start + $length_to_show < length($v2); } - if ( $diff_start + 30 < length($v1) ) { + if ( $diff_start + $max_diff_len <= length($v1) ) { $q1 .= "..." } - if ( $diff_start + 30 < length($v2) ) { + if ( $diff_start + $max_diff_len <= length($v2) ) { $q2 .= "..." } - return ($msg, sprintf("%s at offset %d\nv1 = %s (length %d)\nv2 = %s (length %d)\n", - $msg, $diff_start, $q1, length($v1), $q2, length($v2))); + my $pad= length($q1) > length($q2) ? length($q1) : length($q2); + my $lpad= length(length($v1)) > length(length($v2)) ? length(length($v1)) : length(length($v2)); + + my $issues= ""; + $issues .="; utf8 mismatch" if $v1_is_utf8 != $v2_is_utf8; + $issues .="; length mismatch" if length($v1) != length($v2); + + my $ret= sprintf( "strings different\n" + . "first string difference at octet offset %d%s\n" + . "want-octets = %*s (octets: %*d, utf8-flag: %d)\n" + . " got-octets = %*s (octets: %*d, utf8-flag: %d)\n" + ,$diff_start, $issues, + -$pad, $q1, $lpad, length($v1), $v1_is_utf8, + -$pad, $q2, $lpad, length($v2), $v2_is_utf8, + ); + return $ret; } sub _deep_cmp { my ($x, $y, $seenx, $seeny)= @_; - $seenx||={}; - $seeny||={}; + $seenx ||= {}; + $seeny ||= {}; my $cmp; $cmp= _test("defined mismatch",defined($x),defined($y)) @@ -868,7 +895,7 @@ sub _deep_cmp { die "Unknown reftype '",reftype($x)."'"; } } else { - $cmp= _test_str("strings differ",$x,$y) + $cmp= _cmp_str($x,$y) and return $cmp; } return "" @@ -880,7 +907,7 @@ sub deep_cmp { if ($diff) { my ($reason,$diag)= split /\n/, $diff, 2; fail("$name - $reason"); - diag("$reason\n$diag") if $diag; + diag("$name - $diag") if $diag; return; } return 1; @@ -928,7 +955,7 @@ sub run_roundtrip_tests_internal { or do { fail("$name ($ename, $mname, encoded defined)"); debug_checks(\$data, \$encoded, undef); - last; + next; #test }; my $decoded; @@ -942,7 +969,7 @@ sub run_roundtrip_tests_internal { or do { fail("$name ($ename, $mname, decoded definedness)"); debug_checks(\$data, \$encoded, undef); - last; + next; #test }; # Second roundtrip @@ -957,7 +984,7 @@ sub run_roundtrip_tests_internal { or do { fail("$name ($ename, $mname, encoded2 defined)"); debug_checks(\$data, \$encoded, \$decoded); - last; + next; #test }; my $decoded2; @@ -970,7 +997,7 @@ sub run_roundtrip_tests_internal { defined($decoded2) == defined($data) or do { fail("$name ($ename, $mname, decoded2 defined)"); - last; + next; #test }; # Third roundtrip @@ -985,7 +1012,7 @@ sub run_roundtrip_tests_internal { or do { fail("$name ($ename, $mname, encoded3 defined)"); debug_checks(\$data, \$encoded, \$decoded); - last; + next; #test }; my $decoded3; @@ -998,21 +1025,21 @@ sub run_roundtrip_tests_internal { defined($decoded3) == defined($data) or do { fail("$name ($ename, $mname, decoded3 defined)"); - last; + next; #test }; - deep_cmp($decoded, $data, "$name ($ename, $mname, decoded vs data)") or last; - deep_cmp($decoded2, $data, "$name ($ename, $mname, decoded2 vs data)") or last; - deep_cmp($decoded2, $decoded, "$name ($ename, $mname, decoded2 vs decoded)") or last; + deep_cmp($decoded, $data, "$name ($ename, $mname, decoded vs data)") or next; #test + deep_cmp($decoded2, $data, "$name ($ename, $mname, decoded2 vs data)") or next; #test + deep_cmp($decoded2, $decoded, "$name ($ename, $mname, decoded2 vs decoded)") or next; #test - deep_cmp($decoded3, $data, "$name ($ename, $mname, decoded3 vs data)") or last; - deep_cmp($decoded3, $decoded, "$name ($ename, $mname, decoded3 vs decoded)") or last; - deep_cmp($decoded3, $decoded2, "$name ($ename, $mname, decoded3 vs decoded2)") or last; + deep_cmp($decoded3, $data, "$name ($ename, $mname, decoded3 vs data)") or next; #test + deep_cmp($decoded3, $decoded, "$name ($ename, $mname, decoded3 vs decoded)") or next; #test + deep_cmp($decoded3, $decoded2, "$name ($ename, $mname, decoded3 vs decoded2)") or next; #test if ( $ename =~ /canon/) { - deep_cmp($encoded2, $encoded, "$name ($ename, $mname, encoded2 vs encoded)") or last; - deep_cmp($encoded3, $encoded, "$name ($ename, $mname, encoded3 vs encoded)") or last; - deep_cmp($encoded3, $encoded2, "$name ($ename, $mname, encoded3 vs encoded2)") or last; + deep_cmp($encoded2, $encoded, "$name ($ename, $mname, encoded2 vs encoded)") or next; #test + deep_cmp($encoded3, $encoded, "$name ($ename, $mname, encoded3 vs encoded)") or next; #test + deep_cmp($encoded3, $encoded2, "$name ($ename, $mname, encoded3 vs encoded2)") or next; #test if ($ENV{SEREAL_TEST_SAVE_OUTPUT} and $mname eq 'object-oriented') { use File::Path; @@ -1039,8 +1066,8 @@ sub run_roundtrip_tests_internal { } } } + pass("$name ($ename, $mname)"); } # end method type - pass("$name ($ename)"); } # end test type }