]> gitweb.factorcode.org Git - factor.git/commitdiff
Add extra tests for math.primes
authorSamuel Tardieu <sam@rfc1149.net>
Wed, 24 Jun 2009 11:13:10 +0000 (13:13 +0200)
committerSamuel Tardieu <sam@rfc1149.net>
Wed, 24 Jun 2009 11:15:13 +0000 (13:15 +0200)
basis/math/primes/primes-tests.factor

index a950395bf4b821d8bf6b634798784ef49b559fba..3d21a3e7d60602864c8c69103b3f7929835df436 100644 (file)
@@ -1,5 +1,5 @@
-USING: arrays math math.primes math.primes.miller-rabin
-tools.test ;
+USING: arrays kernel math math.primes math.primes.miller-rabin
+sequences tools.test ;
 IN: math.primes.tests
 
 { 1237 } [ 1234 next-prime ] unit-test
@@ -21,3 +21,8 @@ IN: math.primes.tests
 [ 100000000000031 ] [ 100000000000000 next-prime ] unit-test
 
 [ 49 ] [ 50 random-prime log2 ] unit-test
+
+[ t ] [ 5000077 dup find-relative-prime coprime? ] unit-test
+
+[ 5 t { 14 14 14 14 14 } ]
+[ 5 15 unique-primes [ length ] [ [ prime? ] all? ] [ [ log2 ] map ] tri ] unit-test