local $Scope::Upper::TestGenerator::test = sub {
my ($height, $level, $i, $x) = @_;
my $j = $i < $height - $level ? 0 : (defined $x ? $x : 'undef');
- return "is(\$x, $j, 'x h=$height, l=$level, i=$i');\n";
+ return "verbose_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;
sub check { $x = (defined $x) ? ($x ? 0 : $x . 'x') : 0 }
-{
- no warnings 'redefine';
- *is = sub ($$;$) {
- my ($a, $b, $desc) = @_;
- if (defined $testcase
- and (defined $b) ? (not defined $a or $a != $b) : defined $a) {
- diag <<DIAG;
-=== This testcase failed ===
-$testcase
-==== vvvvv Errors vvvvvv ===
-DIAG
- undef $testcase;
- }
- Test::Leaner::is($a, $b, $desc);
- }
-}
-
for my $level (0 .. 1) {
my $height = $level + 1;
my $tests = Scope::Upper::TestGenerator::gen($height, $level);
- for (@$tests) {
- $testcase = $_;
+ for $testcase (@$tests) {
$x = undef;
- eval;
+ eval $testcase;
diag $@ if $@;
}
}