"url" : "git://github.com/Sereal/Sereal.git"
}
},
- "version" : "3.001_007"
+ "version" : "3.001_008"
}
resources:
bugtracker: https://github.com/Sereal/Sereal/issues
repository: git://github.com/Sereal/Sereal.git
-version: 3.001_007
+version: 3.001_008
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$@";
}
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.
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{
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";
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);
[
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.
]
);
}