]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - t/50-unwind-target.t
Merge perl 5.24 fixes from davem
[perl/modules/Scope-Upper.git] / t / 50-unwind-target.t
index 7e43baa6247d553bf757fd6a5ce20ea6c8cc0036..d5dcd96b5b3f25eb22e88e24af0c911846ff4b57 100644 (file)
@@ -3,9 +3,9 @@
 use strict;
 use warnings;
 
-use Test::More tests => 4;
+use Test::More tests => 6;
 
-use Scope::Upper qw/unwind/;
+use Scope::Upper qw<unwind>;
 
 my @res;
 
@@ -13,17 +13,19 @@ my @res;
  unwind;
  8;
 });
+is $@, '', 'unwind() does not croak';
 is_deeply \@res, [ 7 ], 'unwind()';
 
 @res = (7, eval {
  unwind -1;
  8;
 });
+like $@, qr/^Can't\s+return\s+outside\s+a\s+subroutine/, 'unwind(-1) croaks';
 is_deeply \@res, [ 7 ], 'unwind(-1)';
 
 @res = (7, eval {
- unwind 100;
+ unwind 0;
  8;
 });
-like $@, qr/^Can't\s+return\s+outside\s+a\s+subroutine/, 'unwind(100) croaks';
-is_deeply \@res, [ 7 ], 'unwind(100)';
+like $@, qr/^Can't\s+return\s+outside\s+a\s+subroutine/, 'unwind(0) croaks';
+is_deeply \@res, [ 7 ], 'unwind(0)';