7 use Test::Leaner 'no_plan';
9 use Scope::Upper qw<localize UP HERE>;
11 use Scope::Upper::TestGenerator;
13 local $Scope::Upper::TestGenerator::call = sub {
14 my ($height, $level, $i) = @_;
15 $level = $level ? 'UP ' x $level : 'HERE';
16 return [ "localize '\$x' => 0 => $level;\n" ];
19 local $Scope::Upper::TestGenerator::test = sub {
20 my ($height, $level, $i, $x) = @_;
21 my $j = ($i == $height - $level) ? 0 : (defined $x ? $x : 'undef');
22 return "is(\$x, $j, 'x h=$height, l=$level, i=$i');\n";
25 local $Scope::Upper::TestGenerator::testlocal = sub { '' };
27 local $Scope::Upper::TestGenerator::allblocks = 1;
32 no warnings 'redefine';
34 my ($a, $b, $desc) = @_;
36 and (defined $b) ? (not defined $a or $a != $b) : defined $a) {
38 === This testcase failed ===
40 ==== vvvvv Errors vvvvvv ===
44 Test::Leaner::is($a, $b, $desc);
48 for my $level (0 .. 1) {
49 my $height = $level + 1;
50 my $tests = Scope::Upper::TestGenerator::gen($height, $level);