summaryrefslogtreecommitdiff
path: root/lib/sigtrap.t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-09-25 11:15:35 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-09-25 11:15:35 -0700
commit0ec7d39d922fe99b200d649d3831d277fb8140c6 (patch)
tree90ecc584247a732df8a224772f8cf812961ef919 /lib/sigtrap.t
parent9fb1bf9d6077e18c69220b2091fc278b2e87b3fe (diff)
downloadperl-0ec7d39d922fe99b200d649d3831d277fb8140c6.tar.gz
Try once more to fix sigtrap.t
It produces output like this: lib/sigtrap....................................................sh: line 1: 66151 Abort trap ./perl "-I../lib" -Msigtrap=INT -e 'sub { kill q-INT-, $$ } -> (3)' 2>&1 ok And is effectively skipped on Windows. So this new revision of the test • calls the signal handler directly, instead of trying to trigger it with a signal and • overrides kill globally to stop sigtrap.pm from aborting.
Diffstat (limited to 'lib/sigtrap.t')
-rw-r--r--lib/sigtrap.t16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sigtrap.t b/lib/sigtrap.t
index 30f53398ac..8ee0696c55 100644
--- a/lib/sigtrap.t
+++ b/lib/sigtrap.t
@@ -57,13 +57,15 @@ $SIG{FAKE} = 'IGNORE';
sigtrap->import('untrapped', 'FAKE');
is( $SIG{FAKE}, 'IGNORE', 'respect existing handler set to IGNORE' );
-unlike
- runperl(
- switches => [ '-Msigtrap=INT' ],
- prog => 'sub { kill q-INT-, $$ } -> (3)',
- stderr => 1
- ),
- qr/Modification of a read-only value/,
+fresh_perl_like
+ '
+ BEGIN { *CORE::GLOBAL::kill = sub {} }
+ require sigtrap;
+ import sigtrap "INT";
+ sub { $SIG{INT}->("INT") } -> (3)
+ ',
+ qr/\$ = main::__ANON__\(3\) called/,
+ { stderr => 1 },
"stack-trace does not try to modify read-only arguments"
;