6 use Test::More 'no_plan';
8 use Scope::Upper qw/localize/;
11 use Scope::Upper::TestGenerator;
13 local $Scope::Upper::TestGenerator::call = sub {
14 my ($height, $level, $i) = @_;
15 return [ "localize '\$main::y' => 1 => $level;\n" ];
18 local $Scope::Upper::TestGenerator::test = sub {
19 my ($height, $level, $i) = @_;
20 my $j = ($i == $height - $level) ? 1 : 'undef';
21 return "is(\$main::y, $j, 'y h=$height, l=$level, i=$i');\n";
24 our ($x, $y, $testcase);
27 no warnings 'redefine';
29 my ($a, $b, $desc) = @_;
31 and (defined $b) ? (not defined $a or $a != $b) : defined $a) {
33 === This testcase failed ===
35 ==== vvvvv Errors vvvvvv ===
39 Test::More::is($a, $b, $desc);
43 for my $level (0 .. 4) {
44 for my $height ($level + 1 .. $level + 2) {
45 my $tests = Scope::Upper::TestGenerator::gen($height, $level);