This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In gv.t, check that the installed $SIG{__DIE__} handler is never called.
authorNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 13:27:43 +0000 (13:27 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 13:27:43 +0000 (13:27 +0000)
98e007d4a6d559b3 missed adding a check that the first $SIG{__DIE__} handler
was never called. While tidying, make the second $e lexical, and check that
the second $SIG{__DIE__} handler remains uncalled at the end of its block.

t/op/gv.t

index 765be7e..f796232 100644 (file)
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -12,7 +12,7 @@ BEGIN {
 
 use warnings;
 
-plan( tests => 232 );
+plan( tests => 234 );
 
 # type coersion on assignment
 $foo = 'foo';
@@ -288,10 +288,11 @@ is($j[0], 1);
     is (ref\$v{v}, 'GLOB', 'lvalue assignment preserves globs');
     my $x = readline $v{v};
     is ($x, "perl\n");
+    is ($e, '', '__DIE__ handler never called');
 }
 
 {
-    $e = '';
+    my $e = '';
     # GLOB assignment to tied element
     local $SIG{__DIE__} = sub { $e = $_[0] };
     sub T::TIEARRAY  { bless [] => "T" }
@@ -305,9 +306,10 @@ is($j[0], 1);
       ref\tied(@ary)->[0], 'GLOB',
      'tied elem assignment preserves globs'
     );
-    is ($e, '');
+    is ($e, '', '__DIE__ handler not called');
     my $x = readline $ary[0];
     is($x, "rocks\n");
+    is ($e, '', '__DIE__ handler never called');
 }
 
 {