factor/extra/random/cmwc/cmwc-tests.factor

45 lines
913 B
Factor
Raw Normal View History

2009-10-07 21:06:39 -04:00
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
2009-10-16 16:07:05 -04:00
USING: alien.c-types arrays kernel random random.cmwc sequences
specialized-arrays tools.test ;
SPECIALIZED-ARRAY: uint
2009-10-07 21:06:39 -04:00
IN: random.cmwc.tests
[ ] [
cmwc-4096 [
random-32 drop
] with-random
] unit-test
[
{
4294604858
4294948512
4294929730
4294910948
4294892166
4294873384
4294854602
4294835820
4294817038
4294798256
}
] [
cmwc-4096
2009-10-16 16:07:05 -04:00
4096 iota >uint-array 362436 <cmwc-seed> seed-random [
2009-10-07 21:06:39 -04:00
10 [ random-32 ] replicate
] with-random
] unit-test
[ t ] [
2009-10-07 21:21:09 -04:00
cmwc-4096 [
2009-10-16 16:07:05 -04:00
4096 iota >uint-array 362436 <cmwc-seed> seed-random [
2009-10-07 21:21:09 -04:00
10 [ random-32 ] replicate
] with-random
] [
2009-10-16 16:07:05 -04:00
4096 iota >uint-array 362436 <cmwc-seed> seed-random [
2009-10-07 21:21:09 -04:00
10 [ random-32 ] replicate
] with-random
] bi =
2009-10-07 21:06:39 -04:00
] unit-test