]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/81-stress-level.t
fix unwind()
[perl/modules/Scope-Upper.git] / t / 81-stress-level.t
index 117e5c46d882fd4ad0452b573f4cb79e6d20b5f4..88bc65d298d796754b7952858c2ea28af80589eb 100644 (file)
@@ -3,11 +3,11 @@
 use strict;
 use warnings;
 
-use Test::More 'no_plan';
+use lib 't/lib';
+use Test::Leaner 'no_plan';
 
-use Scope::Upper qw/reap UP HERE/;
+use Scope::Upper qw<reap UP HERE>;
 
-use lib 't/lib';
 use Scope::Upper::TestGenerator;
 
 local $Scope::Upper::TestGenerator::call = sub {
@@ -19,37 +19,19 @@ local $Scope::Upper::TestGenerator::call = sub {
 local $Scope::Upper::TestGenerator::test = sub {
  my ($height, $level, $i) = @_;
  my $j = $i < $height - $level ? 1 : 'undef';
- return "is(\$main::y, $j, 'y h=$height, l=$level, i=$i');\n";
+ return "verbose_is(\$main::y, $j, 'y h=$height, l=$level, i=$i');\n";
 };
 
 our ($x, $y, $testcase);
 
 sub check { $y = 0 unless defined $y; ++$y }
 
-{
- 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::More::is($a, $b, $desc);
- }
-}
-
 for my $level (0 .. 4) {
  for my $height ($level + 1 .. $level + 2) {
   my $tests = Scope::Upper::TestGenerator::gen($height, $level);
-  for (@$tests) {
-   $testcase = $_;
+  for $testcase (@$tests) {
    $x = $y = undef;
-   eval;
+   eval $testcase;
    diag $@ if $@;
   }
  }