[libmath-prime-util-perl] 41/43: Version comparison, make no warnings with test versions
Partha P. Mukherjee
ppm-guest at moszumanska.debian.org
Thu May 21 18:53:09 UTC 2015
This is an automated email from the git hooks/post-receive script.
ppm-guest pushed a commit to annotated tag v0.40
in repository libmath-prime-util-perl.
commit ae3923b20207d9ee6dda93ac43b52ec257f53f5c
Author: Dana Jacobsen <dana at acm.org>
Date: Mon Apr 21 20:49:34 2014 -0700
Version comparison, make no warnings with test versions
---
lib/Math/Prime/Util/RandomPrimes.pm | 5 ++++-
t/16-randomprime.t | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/Math/Prime/Util/RandomPrimes.pm b/lib/Math/Prime/Util/RandomPrimes.pm
index 1179571..9a4543a 100644
--- a/lib/Math/Prime/Util/RandomPrimes.pm
+++ b/lib/Math/Prime/Util/RandomPrimes.pm
@@ -873,7 +873,10 @@ sub _ST_Random_prime { # From FIPS 186-4
unless defined $input_seed && length($input_seed) >= 32;
if (!defined $Digest::SHA::VERSION) {
- eval { require Digest::SHA; $Digest::SHA::VERSION >= 4.00; }
+ eval { require Digest::SHA;
+ my $version = $Digest::SHA::VERSION;
+ $version =~ s/[^\d.]//g;
+ $version >= 4.00; }
or do { croak "Must have Digest::SHA 4.00 or later"; };
}
diff --git a/t/16-randomprime.t b/t/16-randomprime.t
index b51571f..6b9bb8f 100644
--- a/t/16-randomprime.t
+++ b/t/16-randomprime.t
@@ -16,7 +16,10 @@ my $broken64 = (18446744073709550592 == ~0);
my $extra = defined $ENV{EXTENDED_TESTING} && $ENV{EXTENDED_TESTING};
my $maxbits = $use64 ? 64 : 32;
my $do_st = 1;
-$do_st = 0 unless eval { require Digest::SHA; $Digest::SHA::VERSION >= 4.00; };
+$do_st = 0 unless eval { require Digest::SHA;
+ my $version = $Digest::SHA::VERSION;
+ $version =~ s/[^\d.]//g;
+ $version >= 4.00; };
my @random_to = (2, 3, 4, 5, 6, 7, 8, 9, 100, 1000, 1000000, 4294967295);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git
More information about the Pkg-perl-cvs-commits
mailing list