X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F31-localize_elem-level.t;h=cd700c7a4cb8a74c5b671a3ef2458944d315eddb;hb=eef3f2764e7018e3eaf2f1d11f249b510d023a2d;hp=a4845b2541a26158bf321b0210b4040ac3cc19b5;hpb=0a6221d3f467b5f819e3c119b4cda0218399cb51;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/31-localize_elem-level.t b/t/31-localize_elem-level.t index a4845b2..cd700c7 100644 --- a/t/31-localize_elem-level.t +++ b/t/31-localize_elem-level.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/localize_elem UP HERE/; +use Scope::Upper qw; -use lib 't/lib'; use Scope::Upper::TestGenerator; our ($x, $testcase); @@ -29,11 +29,10 @@ our @a; for my $level (0 .. 2) { for my $height ($level + 1 .. $level + 2) { my $tests = Scope::Upper::TestGenerator::gen($height, $level); - for (@$tests) { - $testcase = $_; + for $testcase (@$tests) { $x = undef; @a = (1, 2); - eval; + eval $testcase; diag $@ if $@; } } @@ -43,7 +42,7 @@ local $Scope::Upper::TestGenerator::call = sub { my ($height, $level, $i) = @_; $level = $level ? 'UP ' x $level : 'HERE'; return [ "localize_elem '%main::h', 'a' => 1 => $level;\n" ]; -}; +}; local $Scope::Upper::TestGenerator::test = sub { my ($height, $level, $i) = @_; @@ -56,11 +55,10 @@ our %h; for my $level (0 .. 2) { for my $height ($level + 1 .. $level + 2) { my $tests = Scope::Upper::TestGenerator::gen($height, $level); - for (@$tests) { - $testcase = $_; + for $testcase (@$tests) { $x = undef; %h = (); - eval; + eval $testcase; diag $@ if $@; } }