This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #45173] port the test to MSWin32
authorTony Cook <tony@develop-help.com>
Tue, 26 Jun 2012 07:56:44 +0000 (17:56 +1000)
committerTony Cook <tony@develop-help.com>
Tue, 26 Jun 2012 08:22:00 +0000 (18:22 +1000)
t/op/sigdispatch.t

index 13303fd..1ce047d 100644 (file)
@@ -10,6 +10,7 @@ use strict;
 use Config;
 
 plan tests => 29;
+$| = 1;
 
 watchdog(15);
 
@@ -150,11 +151,13 @@ like $@, qr/No such hook: __DIE__\\0whoops at/;
 
 # [perl #45173]
 {
-    my $hup_called;
-    local $SIG{HUP} = sub { $hup_called = 1 };
+    my $int_called;
+    local $SIG{INT} = sub { $int_called = 1; };
     $@ = "died";
     is($@, "died");
-    kill 'HUP', $$;
-    is($hup_called, 1);
+    kill 'INT', $$;
+    # this is needed to ensure signal delivery on MSWin32
+    sleep(1);
+    is($int_called, 1);
     is($@, "died");
 }