This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add tests for [perl #72340] sigtrap attempts to modify read-only thing
authorFather Chrysostomos <sprout@cpan.org>
Fri, 24 Sep 2010 07:34:04 +0000 (00:34 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 24 Sep 2010 07:34:04 +0000 (00:34 -0700)
lib/sigtrap.t

index 7e8ddef..0469a9a 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
 use strict;
 use Config;
 
-plan 15;
+plan 16;
 
 use_ok( 'sigtrap' );
 
@@ -57,6 +57,16 @@ $SIG{FAKE} = 'IGNORE';
 sigtrap->import('untrapped', 'FAKE');
 is( $SIG{FAKE}, 'IGNORE', 'respect existing handler set to IGNORE' );
 
+fresh_perl_like
+  '
+    use sigtrap "INT";
+    sub { kill "INT", $$ } -> (3)
+  ',
+   qr/\$ = main::__ANON__\(3\) called/,
+  { stderr => 1 },
+  "stack-trace does not try to modify read-only arguments"
+;
+
 my $out = tie *STDOUT, 'TieOut';
 $SIG{FAKE} = 'DEFAULT';
 $sigtrap::Verbose = 1;