X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F22-localize-block.t;h=80dcc3841190959d6d0bfa685af9ef085e5a16c8;hb=bed9ac0713800543385ae073d3c046fb3390190a;hp=f9501e2b9d333f38f83d8a703a4c4f3f3914ae99;hpb=bac4fc46c2d48ce5db75de6c88e0983aeeedf865;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/22-localize-block.t b/t/22-localize-block.t index f9501e2..80dcc38 100644 --- a/t/22-localize-block.t +++ b/t/22-localize-block.t @@ -3,54 +3,37 @@ use strict; use warnings; -use Test::More 'no_plan'; +use lib 't/lib'; +use Test::Leaner 'no_plan'; -use Scope::Upper qw/localize/; +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 [ "localize '\$x' => 0 => $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::testlocal = sub { '' }; +local $Scope::Upper::TestGenerator::local_test = sub { '' }; local $Scope::Upper::TestGenerator::allblocks = 1; our ($x, $testcase); -{ - no warnings 'redefine'; - *is = sub ($$;$) { - my ($a, $b, $desc) = @_; - if (defined $testcase - and (defined $b) ? (not defined $a or $a != $b) : defined $a) { - diag <