From: gregor herrmann Date: Tue, 5 Aug 2014 17:27:54 +0000 (+0200) Subject: Imported Upstream version 3.001.008 X-Git-Tag: archive/raspbian/4.017+ds-1+rpi1~1^2~3^2~19 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4cfe94849634a4c9f82c8290e8dec80290c26703;p=libsereal-encoder-perl.git Imported Upstream version 3.001.008 --- diff --git a/META.json b/META.json index 5cb0a60..82c26dc 100644 --- a/META.json +++ b/META.json @@ -55,5 +55,5 @@ "url" : "git://github.com/Sereal/Sereal.git" } }, - "version" : "3.001_007" + "version" : "3.001_008" } diff --git a/META.yml b/META.yml index e92ef75..47b03f1 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_007 +version: 3.001_008 diff --git a/author_tools/hobodecoder.pl b/author_tools/hobodecoder.pl index 831f7ae..3f1ec2f 100644 --- a/author_tools/hobodecoder.pl +++ b/author_tools/hobodecoder.pl @@ -10,10 +10,12 @@ BEGIN { eval ' use Sereal::Encoder::Constants qw(:all); @constants= @Sereal::Encoder::Constants::EXPORT_OK; + print "Loaded constants from $INC{q(Sereal/Encoder/Constants.pm)}"; 1; ' or do { $err= $@; eval ' use Sereal::Decoder::Constants qw(:all); @constants= @Sereal::Decoder::Constants::EXPORT_OK; + print "Loaded constants from $INC{q(Sereal/Decoder/Constants.pm)}"; 1; ' } or die "No encoder/decoder constants: $err\n$@"; } diff --git a/lib/Sereal/Encoder.pm b/lib/Sereal/Encoder.pm index c7b1e4e..31129ea 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_007'; # Don't forget to update the TestCompat set for testing against installed decoders! +our $VERSION = '3.001_008'; # 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. diff --git a/t/010_desperate.t b/t/010_desperate.t index 1cae0d3..7a3eb9c 100644 --- a/t/010_desperate.t +++ b/t/010_desperate.t @@ -31,13 +31,13 @@ sub run_tests { my ($extra_name, $opt_hash) = @_; setup_tests(3); foreach my $bt (@BasicTests) { - my (undef, $exp, $name) = @$bt; + my (undef, $expect, $name, $accept_cond, @accept) = @$bt; - $exp = $exp->($opt_hash) if ref($exp) eq 'CODE'; + $expect = $expect->($opt_hash) if ref($expect) eq 'CODE'; $name="unnamed" if not defined $name; #next unless $name=~/PAD/; - $exp = Header(). $exp; + $expect = Header(). $expect; my $enc = Sereal::Encoder->new($opt_hash ? $opt_hash : ()); my $out; eval{ @@ -45,12 +45,21 @@ sub run_tests { 1; } or die "Failed to encode: \n$@\n". Data::Dumper::Dumper($bt->[0]); ok(defined $out, "($extra_name) defined: $name"); - #is(length($out), length($exp)); - is(Data::Dumper::qquote($out), Data::Dumper::qquote($exp), "($extra_name) correct: $name") + + if ($accept_cond and $out ne $expect) { + foreach my $accept (@accept) { + if ($out eq $accept) { + diag("Using alternate expect for test '$name'"); + $expect= $accept; + last; + } + } + } + is(Data::Dumper::qquote($out), Data::Dumper::qquote($expect), "($extra_name) correct: $name") or do { if ($ENV{DEBUG_SEREAL}) { print STDERR "\nEXPECTED:\n"; - hobodecode($exp); + hobodecode($expect); print STDERR "\nGOT:\n"; hobodecode($out); print STDERR "\n"; diff --git a/t/lib/Sereal/TestSet.pm b/t/lib/Sereal/TestSet.pm index 7946298..d3b9f54 100644 --- a/t/lib/Sereal/TestSet.pm +++ b/t/lib/Sereal/TestSet.pm @@ -13,6 +13,7 @@ use Devel::Peek; use Encode qw(encode_utf8 is_utf8); use Scalar::Util qw(reftype blessed refaddr); use Data::Dumper; +use Config; # Dynamically load constants from whatever is being tested our ($Class, $ConstClass); @@ -523,7 +524,10 @@ sub setup_tests { [ sub { \@_ }->(!1,!0), array(chr(SRL_HDR_FALSE),chr(SRL_HDR_TRUE)), - "true/false" + "true/false", + $Config{usethreads}, # if this is true + array(chr(SRL_HDR_FALSE),chr(0b0000_0001)), # the we will accept this + array(chr(0b0000_0000),chr(0b0000_0001)), # or this if the test fails. ] ); }