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.
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"
;