X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F12-reap-block.t;h=c76e066ec7667c2aa59e753eb1f5bb01657489c1;hb=bed9ac0713800543385ae073d3c046fb3390190a;hp=86e602210349e3dff90fc9abe5fd892c373a7336;hpb=bac4fc46c2d48ce5db75de6c88e0983aeeedf865;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/12-reap-block.t b/t/12-reap-block.t index 86e6022..c76e066 100644 --- a/t/12-reap-block.t +++ b/t/12-reap-block.t @@ -3,30 +3,31 @@ use strict; use warnings; -use Test::More 'no_plan'; +use lib 't/lib'; +use Test::Leaner 'no_plan'; -use Scope::Upper qw/reap/; +use Scope::Upper qw; -use lib 't/lib'; use Scope::Upper::TestGenerator; local $Scope::Upper::TestGenerator::call = sub { my ($height, $level, $i) = @_; + $level = $level ? 'UP ' x $level : 'HERE'; return [ "reap \\&check => $level;\n" ]; }; local $Scope::Upper::TestGenerator::test = sub { my ($height, $level, $i, $x) = @_; my $j = $i < $height - $level ? 0 : (defined $x ? $x : 'undef'); - return "is(\$x, $j, 'x h=$height, l=$level, i=$i');\n"; + return "verbose_is(\$x, $j, 'x h=$height, l=$level, i=$i');\n"; }; -local $Scope::Upper::TestGenerator::local = sub { +local $Scope::Upper::TestGenerator::local_decl = sub { my ($height, $level, $i, $x) = @_; return $i == $height - $level ? "\$x = $x;\n" : "local \$x = $x;\n"; }; -local $Scope::Upper::TestGenerator::testlocal = sub { '' }; +local $Scope::Upper::TestGenerator::local_test = sub { '' }; local $Scope::Upper::TestGenerator::allblocks = 1; @@ -34,30 +35,12 @@ our ($x, $testcase); sub check { $x = (defined $x) ? ($x ? 0 : $x . 'x') : 0 } -{ - no warnings 'redefine'; - *is = sub ($$;$) { - my ($a, $b, $desc) = @_; - if (defined $testcase - and (defined $b) ? (not defined $a or $a != $b) : defined $a) { - diag <