Subject: | test 1 in t/rand_time.t fails occasionally |
Hi,
test 1 in t/rand_time.t fails when rand_time() returns "00:00:00", since
_to_secs() then returns 0 which evaluates to false. This happens with a
probability of about 7% and was found in an automatic build of the
Debian packaged version of Data::Random - see
http://bugs.debian.org/427188 .
A simple fix is to test if the return value is defined. Proposed patch
attached.
Cheers,
--
Niko Tyni (on behalf of the Debian Perl Group)
ntyni@iki.fi
Subject: | 427188.patch |
--- t/rand_time.t 2007/06/02 12:35:37 1.1
+++ t/rand_time.t 2007/06/02 12:35:50
@@ -16,7 +16,7 @@
while ( $pass && $i < $max_secs ) {
my $time = rand_time();
- $pass = 0 unless _to_secs($time);
+ $pass = 0 unless defined _to_secs($time);
$i++;
}