Address 250_ping_hires.t failure
authorJerry D. Hedden <jdhedden@cpan.org>
Sun, 1 Jul 2007 15:23:37 +0000 (11:23 -0400)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 2 Jul 2007 13:28:50 +0000 (13:28 +0000)
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510707011223u7557fc53m9df980815479892a@mail.gmail.com>

p4raw-id: //depot/perl@31517

lib/Net/Ping/t/250_ping_hires.t

index 91e905f..a2187d0 100644 (file)
@@ -23,7 +23,7 @@ BEGIN {
   }
 }
 
-use Test;
+use Test qw(plan ok $TESTERR);
 use Net::Ping;
 plan tests => 8;
 
@@ -58,6 +58,7 @@ ok $ret;
 
 # It is extremely likely that the duration contains a decimal
 # point if Time::HiRes is functioning properly, except when it
-# it is fast enough to be "zero".
-print "# duration=[$duration]\n";
-ok $duration =~ /\.|^0$/;
+# is fast enough to be "0", or slow enough to be exactly "1".
+if (! ok($duration =~ /\.|^[01]$/)) {
+    print($TESTERR "# duration=[$duration]\n");
+}