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 '\$main::y' => 1 => $level;\n" ];
19 local $Scope::Upper::TestGenerator::test = sub {
20 my ($height, $level, $i) = @_;
21 my $j = ($i == $height - $level) ? 1 : 'undef';
22 return "is(\$main::y, $j, 'y h=$height, l=$level, i=$i');\n";
25 our ($x, $y, $testcase);
28 no warnings 'redefine';
30 my ($a, $b, $desc) = @_;
32 and (defined $b) ? (not defined $a or $a != $b) : defined $a) {
34 === This testcase failed ===
36 ==== vvvvv Errors vvvvvv ===
40 Test::Leaner::is($a, $b, $desc);
44 for my $level (0 .. 2) {
45 for my $height ($level + 1 .. $level + 2) {
46 my $tests = Scope::Upper::TestGenerator::gen($height, $level);