diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-09-24 00:34:04 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-09-24 00:34:04 -0700 |
commit | 7728d0a528574233c63bf7d3b1b65e4d659156b6 (patch) | |
tree | f794607616f5b8616c1921017fec94d9952365a6 /lib/sigtrap.t | |
parent | 972fc2eb7a3f863aa76a552076fe3decf92c3ec7 (diff) | |
download | perl-7728d0a528574233c63bf7d3b1b65e4d659156b6.tar.gz |
Add tests for [perl #72340] sigtrap attempts to modify read-only thing
Diffstat (limited to 'lib/sigtrap.t')
-rw-r--r-- | lib/sigtrap.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/sigtrap.t b/lib/sigtrap.t index 7e8ddef66d..0469a9ac52 100644 --- a/lib/sigtrap.t +++ b/lib/sigtrap.t @@ -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; |