X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F12-reap-block.t;h=c76e066ec7667c2aa59e753eb1f5bb01657489c1;hb=e8b8c066e959120b28db728fc7640b606f29faa6;hp=7b15b64bdddf215f8e81afb51b395b58be9cacce;hpb=0a6221d3f467b5f819e3c119b4cda0218399cb51;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/12-reap-block.t b/t/12-reap-block.t index 7b15b64..c76e066 100644 --- a/t/12-reap-block.t +++ b/t/12-reap-block.t @@ -3,11 +3,11 @@ use strict; use warnings; -use Test::More 'no_plan'; +use lib 't/lib'; +use Test::Leaner 'no_plan'; -use Scope::Upper qw/reap UP HERE/; +use Scope::Upper qw; -use lib 't/lib'; use Scope::Upper::TestGenerator; local $Scope::Upper::TestGenerator::call = sub { @@ -19,15 +19,15 @@ local $Scope::Upper::TestGenerator::call = sub { 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; @@ -35,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 <