X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F50-unwind-target.t;h=d5dcd96b5b3f25eb22e88e24af0c911846ff4b57;hb=76f7748a793b1d04798c743cc70b46a1bf657300;hp=9ef70ecf7a213fc80c99621d455b7389c6f7d452;hpb=00eb4513e6dc65546222404eaa0e1c4910587c70;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/50-unwind-target.t b/t/50-unwind-target.t index 9ef70ec..d5dcd96 100644 --- a/t/50-unwind-target.t +++ b/t/50-unwind-target.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 6; use Scope::Upper qw; @@ -13,12 +13,14 @@ 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 {