[libmath-prime-util-perl] 03/43: Don't die in t/04 if platform doesn't have NaN (some activestate)

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:53:05 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 3ac854a32cf32282cedbc86562a48945e928fb16
Author: Dana Jacobsen <dana at acm.org>
Date:   Mon Mar 3 00:40:20 2014 -0800

    Don't die in t/04 if platform doesn't have NaN (some activestate)
---
 t/04-inputvalidation.t | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/t/04-inputvalidation.t b/t/04-inputvalidation.t
index 96e295e..ba4f2d0 100644
--- a/t/04-inputvalidation.t
+++ b/t/04-inputvalidation.t
@@ -63,11 +63,17 @@ my $infinity = 0+'inf';  # Might be 0 on some platforms.
 $infinity = +(20**20**20) if 65535 > $infinity;
 my $nan = -sin($infinity);
 
-eval { next_prime($infinity); };
-like($@, qr/must be a positive integer/, "next_prime( infinity )");
+SKIP: {
+  skip "Your machine seems to not have infinity", 1 if 65535 > $infinity;
+  eval { next_prime($infinity); };
+  like($@, qr/must be a positive integer/, "next_prime( infinity )");
+}
 
-eval { next_prime($nan); };
-like($@, qr/must be a positive integer/, "next_prime( nan ) [nan = '$nan']");
+SKIP: {
+  skip "Your machine seems to not have NaN", 1 if $nan == 0;
+  eval { next_prime($nan); };
+  like($@, qr/must be a positive integer/, "next_prime( nan ) [nan = '$nan']");
+}
 
 
 SKIP: {

-- 
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