# alarm time might be one second less than you said.
is( $@, "ALARM!\n", 'alarm w/$SIG{ALRM} vs inf loop' );
-ok( $diff == 3 || $diff == 2, ' right time' );
+ok( abs($diff - 3) <= 1, " right time" );
my $start_time = time;
# alarm time might be one second less than you said.
is( $@, "ALARM!\n", 'alarm w/$SIG{ALRM} vs system()' );
-TODO: {
- local $TODO = "alarm() can't stop a system call with \$SIG{ALRM} set";
- ok( $diff == 3 || $diff == 2, ' right time' );
+{
+ local $TODO = "Why does system() block alarm() on $^O?"
+ if $^O eq 'VMS' || $^O eq'MacOS' || $^O eq 'dos';
+ ok( abs($diff - 3) <= 1, " right time (waited $diff secs for 3-sec alarm)" );
}