use lib 't/lib';
use Test::Leaner 'no_plan';
-use Scope::Upper qw/localize UP HERE/;
+use Scope::Upper qw<localize UP HERE>;
use Scope::Upper::TestGenerator;
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::testlocal = sub { '' };
+local $Scope::Upper::TestGenerator::local_test = sub { '' };
local $Scope::Upper::TestGenerator::allblocks = 1;
our ($x, $testcase);
-{
- 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 $@;
}
}