]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/12-reap-block.t
Rework how Scope::Upper::TestGenerator generates its 'local' tests
[perl/modules/Scope-Upper.git] / t / 12-reap-block.t
index 86e602210349e3dff90fc9abe5fd892c373a7336..fda9aca7d12686cea427af58d8df21c905b605aa 100644 (file)
@@ -3,15 +3,16 @@
 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<reap UP HERE>;
 
-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" ];
 };
 
@@ -21,12 +22,12 @@ local $Scope::Upper::TestGenerator::test = sub {
  return "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;
 
@@ -47,7 +48,7 @@ $testcase
 DIAG
    undef $testcase;
   }
-  Test::More::is($a, $b, $desc);
+  Test::Leaner::is($a, $b, $desc);
  }
 }