Skip to content

Commit

Permalink
Add tests for the first 20 psp(2)'s
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Mar 31, 2009
1 parent 531d6a0 commit b85b30a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions t/is_pseudoprime.t
@@ -1,6 +1,6 @@
#!perl -T

use Test::More tests => 51;
use Test::More tests => 71;

use Math::Primality qw/ is_pseudoprime /;

Expand Down Expand Up @@ -38,4 +38,13 @@ for my $base (@bases) {
ok(!is_pseudoprime( 999895175363161, 7 ), ' 7 is a factor of 999895175363161 and hence it is not a psp(7)');

map {
ok(!is_pseudoprime( $_ , 13 ), "13 is a factor of $_ and hence it is not a psp(13)") } (999838193331601,999878556600001,999902676805201) ;
ok(!is_pseudoprime( $_ , 13 ), "13 is a factor of $_ and hence it is not a psp(13)") } (999838193331601,999878556600001,999902676805201) ;

# First 20 psp(2)'s
map {
ok( is_pseudoprime($_), "$_ is a psp(2)" );
} qw/
341 561 645 1105 1387 1729 1905 2047
2465 2701 2821 3277 4033 4369 4371
4681 5461 6601 7957 8321
/;

0 comments on commit b85b30a

Please sign in to comment.