factor/basis/random/random-tests.factor

26 lines
855 B
Factor
Raw Normal View History

USING: random sequences tools.test kernel math math.functions
sets grouping random.private ;
2008-03-28 23:10:01 -04:00
IN: random.tests
[ 4 ] [ 4 random-bytes length ] unit-test
[ 7 ] [ 7 random-bytes length ] unit-test
2008-03-28 23:12:11 -04:00
[ 4 ] [ [ 4 random-bytes length ] with-secure-random ] unit-test
[ 7 ] [ [ 7 random-bytes length ] with-secure-random ] unit-test
2008-09-05 20:29:14 -04:00
[ 2 ] [ V{ 10 20 30 } [ delete-random drop ] keep length ] unit-test
[ V{ } [ delete-random drop ] keep length ] must-fail
[ t ] [ 10000 [ 0 [ drop 187 random + ] reduce ] keep / 2 * 187 10 ~ ] unit-test
[ t ] [ 10000 [ 0 [ drop 400 random + ] reduce ] keep / 2 * 400 10 ~ ] unit-test
[ t ] [ 1000 [ 400 random ] replicate prune length 256 > ] unit-test
2008-10-06 00:09:10 -04:00
[ f ] [ 0 random ] unit-test
[ f ]
[ 100 [ { 0 1 } random ] replicate all-equal? ] unit-test
[ t ]
[ { 1 2 } [ length ] [ >randomize-range length ] bi - 1 = ] unit-test