Permalink
Browse files

Add simple bigint test case

  • Loading branch information...
1 parent 15f4ade commit 8449f7a846cc2cdca480d7f8f2a75c713e0053ef @danaj danaj committed with Feb 4, 2013
Showing with 12 additions and 2 deletions.
  1. +6 −1 t/next_prime.t
  2. +6 −1 t/prev_prime.t
View
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 498;
+use Test::More tests => 498 + 1;
use Math::Primality qw/next_prime/;
use Math::GMPz;
@@ -46,3 +46,8 @@ for (my $i = 0; $i < (scalar @small_primes) - 1; $i++) {
$n = next_prime($small_primes[$i]);
is("$n", "$small_primes[$i+1]", "the next prime after $small_primes[$i] is $small_primes[$i+1] ?= $n");
}
+
+{
+ $n = next_prime("777777777777777777777777");
+ is("$n", "777777777777777777777787", "next_prime 777777777777777777777777");
+}
View
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 500;
+use Test::More tests => 500 + 1;
use Math::Primality qw/prev_prime/;
use Math::GMPz;
@@ -48,3 +48,8 @@ for (my $i = (scalar @small_primes) - 1; $i > 0; $i--) {
$n = prev_prime($small_primes[$i]);
is("$n", "$small_primes[$i-1]", "the previous prime before $small_primes[$i] is $small_primes[$i-1]");
}
+
+{
+ $n = prev_prime("777777777777777777777777");
+ is("$n", "777777777777777777777767", "prev_prime 777777777777777777777777");
+}

0 comments on commit 8449f7a

Please sign in to comment.