This eliminates the action-at-a-distance file scoped lexical.
# Force Data::Dumper::Dump to use perl. We test Dumpxs explicitly by calling
# it direct. Out here it lets us knobble the next if to test that the perl
# Force Data::Dumper::Dump to use perl. We test Dumpxs explicitly by calling
# it direct. Out here it lets us knobble the next if to test that the perl
- my ($string, $desc) = @_;
+ my ($string, $desc, $want) = @_;
Carp::confess("Tests must have a description")
unless $desc;
Carp::confess("Tests must have a description")
unless $desc;
}
$have =~ s/([A-Z]+)\(0x[0-9a-f]+\)/$1(0xdeadbeef)/g
}
$have =~ s/([A-Z]+)\(0x[0-9a-f]+\)/$1(0xdeadbeef)/g
- if $WANT =~ /deadbeef/;
- is($have, $WANT, $desc);
+ if $want =~ /deadbeef/;
+ is($have, $want, $desc);
}
else {
$have =~ s/([A-Z]+)\(0x[0-9a-f]+\)/$1(0xdeadbeef)/g
}
else {
$have =~ s/([A-Z]+)\(0x[0-9a-f]+\)/$1(0xdeadbeef)/g
- if $WANT =~ /deadbeef/;
- is($have, $WANT, "$desc after eval");
+ if $want =~ /deadbeef/;
+ is($have, $want, "$desc after eval");
-sub SKIP_TEST {
- my $reason = shift;
- SKIP: {
- skip($reason, 3);
- }
-}
-
sub SKIP_BOTH {
my $reason = shift;
SKIP: {
sub SKIP_BOTH {
my $reason = shift;
SKIP: {
}
local $Test::Builder::Level = $Test::Builder::Level + 1;
}
local $Test::Builder::Level = $Test::Builder::Level + 1;
- $WANT = $want;
- TEST($testcase_pp, $desc_pp);
+ TEST($testcase_pp, $desc_pp, $want);
- return SKIP_TEST($skip_xs)
- if $skip_xs;
- $WANT = $want_xs;
- TEST($testcase, $desc);
+ if ($skip_xs) {
+ SKIP: {
+ skip($skip_xs, 3);
+ }
+ }
+ else {
+ TEST($testcase, $desc, $want_xs);
+ }