Skip to content

Commit

Permalink
Add simple bigint test case
Browse files Browse the repository at this point in the history
  • Loading branch information
danaj authored and leto committed Feb 5, 2013
1 parent 15f4ade commit 8449f7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion t/next_prime.t
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
7 changes: 6 additions & 1 deletion t/prev_prime.t
Expand Up @@ -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;
Expand Down Expand Up @@ -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.