7 use Test::Leaner 'no_plan';
9 use Scope::Upper qw<reap 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 [ "reap \\&check => $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);
27 sub check { $y = 0 unless defined $y; ++$y }
30 no warnings 'redefine';
32 my ($a, $b, $desc) = @_;
34 and (defined $b) ? (not defined $a or $a != $b) : defined $a) {
36 === This testcase failed ===
38 ==== vvvvv Errors vvvvvv ===
42 Test::Leaner::is($a, $b, $desc);
46 for my $level (0 .. 2) {
47 for my $height ($level + 1 .. $level + 2) {
48 my $tests = Scope::Upper::TestGenerator::gen($height, $level);