Browse files

Add some failing tests for is_strong_pseudoprime pointed out by @danaj

  • Loading branch information...
1 parent 3048afe commit b47fc7788dc3ea75b35fa782d262de9c9a16955b @leto committed Mar 24, 2013
Showing with 11 additions and 1 deletion.
  1. +11 −1 t/is_strong_pseudoprime.t
View
12 t/is_strong_pseudoprime.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 512;
+use Test::More;
use Math::Primality qw/ is_strong_pseudoprime /;
use Math::GMPz;
@@ -23,12 +23,22 @@ ok(!is_strong_pseudoprime(4),'4 is not a spsp' );
ok( is_strong_pseudoprime( 1093**2 ), '1093**2 is a spsp');
ok(!is_strong_pseudoprime(1000), '1000 is not a spsp');
+is( is_strong_pseudoprime( 3, 3), 1, "spsp( 3, 3)");
+is( is_strong_pseudoprime( 11, 11), 1, "spsp( 11, 11)");
+is( is_strong_pseudoprime( 89, 5785), 1, "spsp( 89, 5785)");
+is( is_strong_pseudoprime(257, 6168), 1, "spsp(257, 6168)");
+is( is_strong_pseudoprime(367, 367), 1, "spsp(367, 367)");
+is( is_strong_pseudoprime(367, 1101), 1, "spsp(367, 1101)");
+is( is_strong_pseudoprime(49001, 921211727), 0, "spsp(49001, 921211727)");
+is( is_strong_pseudoprime( 331, 921211727), 1, "spsp( 331, 921211727)");
+is( is_strong_pseudoprime(49117, 921211727), 1, "spsp(49117, 921211727)");
while(<DATA>) {
chomp;
ok( is_strong_pseudoprime( $_ ), "$_ is a spsp");
}
+done_testing;
__DATA__
2047

0 comments on commit b47fc77

Please sign in to comment.