This is an automated email from the git hooks/post-receive script. ppm-guest pushed a commit to annotated tag v0.14 in repository libmath-prime-util-perl.
commit d0834cb3e011787d82a071aa28758200e016c159 Author: Dana Jacobsen <d...@acm.org> Date: Thu Nov 29 16:09:18 2012 -0800 Modify tests to handle Win32 infinity also --- t/16-randomprime.t | 2 +- t/18-functions.t | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/t/16-randomprime.t b/t/16-randomprime.t index 8292294..6ab84bf 100644 --- a/t/16-randomprime.t +++ b/t/16-randomprime.t @@ -66,7 +66,7 @@ plan tests => 13+4+4+4 + (2 * scalar @random_nbit_tests) + 0; -my $infinity = ~0 * ~0; +my $infinity = 20**20**20; my $nrandom_range_samples = $extra ? 1000 : 50; ok(!eval { random_prime(undef); }, "random_prime(undef)"); diff --git a/t/18-functions.t b/t/18-functions.t index f597652..523a552 100644 --- a/t/18-functions.t +++ b/t/18-functions.t @@ -7,6 +7,7 @@ use Math::Prime::Util qw/prime_count ExponentialIntegral LogarithmicIntegral Rie my $use64 = Math::Prime::Util::prime_get_config->{'maxbits'} > 32; my $extra = defined $ENV{RELEASE_TESTING} && $ENV{RELEASE_TESTING}; +my $infinity = 20**20**20; plan tests => 3 + 6 + 1 + 16 + 11 + 9; @@ -17,13 +18,13 @@ like($@, qr/invalid/i, "R(0) is invalid"); eval { RiemannR(-1); }; like($@, qr/invalid/i, "R(-1) is invalid"); -cmp_ok( ExponentialIntegral(0), '<=', 0 - (~0 * ~0), "Ei(0) is -infinity" ); -cmp_ok( ExponentialIntegral('-inf'),'==', 0, "Ei(-inf) is 0" ); -cmp_ok( ExponentialIntegral('inf'), '>=', 0 + (~0 * ~0), "Ei(inf) is infinity" ); +cmp_ok( ExponentialIntegral(0), '<=',-$infinity, "Ei(0) is -infinity"); +cmp_ok( ExponentialIntegral(-$infinity),'==', 0, "Ei(-inf) is 0" ); +cmp_ok( ExponentialIntegral($infinity), '>=', $infinity, "Ei(inf) is infinity"); -cmp_ok( LogarithmicIntegral(0), '==', 0, "li(0) is 0" ); -cmp_ok( LogarithmicIntegral(1), '<=', 0 - (~0 * ~0), "li(1) is -infinity" ); -cmp_ok( LogarithmicIntegral('inf'),'>=', 0 + (~0 * ~0), "li(inf) is infinity" ); +cmp_ok( LogarithmicIntegral(0), '==', 0, "li(0) is 0" ); +cmp_ok( LogarithmicIntegral(1), '<=',-$infinity, "li(1) is -infinity" ); +cmp_ok( LogarithmicIntegral('inf'),'>=', $infinity, "li(inf) is infinity" ); # Example used in Math::Cephes cmp_closeto( ExponentialIntegral(2.2), 5.732614700, 1e-06, "Ei(2.2)"); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits