]> gitweb.factorcode.org Git - factor.git/blob - extra/random/blum-blum-shub/blum-blum-shub-tests.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / random / blum-blum-shub / blum-blum-shub-tests.factor
1 USING: kernel math tools.test namespaces random
2 random.blum-blum-shub alien.c-types sequences splitting
3 grouping ;
4 IN: blum-blum-shub.tests
5
6 [ 887708070 ] [
7     T{ blum-blum-shub f 590695557939 811977232793 } clone random-32*
8 ] unit-test
9
10
11 [ 887708070 ] [
12     T{ blum-blum-shub f 590695557939 811977232793 } clone [
13         32 random-bits
14         little-endian? [ <uint> reverse *uint ] unless
15     ] with-random
16 ] unit-test
17
18 [ 5726770047455156646 ] [
19     T{ blum-blum-shub f 590695557939 811977232793 } clone [
20         64 random-bits
21         little-endian? [ <ulonglong> 4 group [ reverse ] map concat *ulonglong ] unless
22     ] with-random
23 ] unit-test
24
25 [ 3716213681 ]
26 [
27     100 T{ blum-blum-shub f 200352954495 846054538649 } clone tuck [
28         random-32* drop
29     ] curry times
30     random-32*
31 ] unit-test