fix bug in random-bytes* when no random-32* exists

db4
Doug Coleman 2009-10-01 11:58:52 -05:00
parent 0e97398da8
commit ccc69a5ef4
2 changed files with 4 additions and 1 deletions

View File

@ -30,3 +30,6 @@ IN: random.tests
[ 3 ] [ { 1 2 3 4 } 3 sample prune length ] unit-test
[ 99 ] [ 100 99 sample prune length ] unit-test
[ ]
[ [ 100 random-bytes ] with-system-random drop ] unit-test

View File

@ -22,7 +22,7 @@ M: object random-bytes* ( n tuple -- byte-array )
[ 2drop ] [ random-32* 4 >le swap head over push-all ] if
] bi-curry bi* ;
M: object random-32* ( tuple -- r ) 4 random-bytes* le> ;
M: object random-32* ( tuple -- r ) 4 swap random-bytes* le> ;
ERROR: no-random-number-generator ;