]> gitweb.factorcode.org Git - factor.git/blob - extra/random/lagged-fibonacci/lagged-fibonacci-tests.factor
Switch to https urls
[factor.git] / extra / random / lagged-fibonacci / lagged-fibonacci-tests.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: fry kernel math.functions random random.lagged-fibonacci
4 sequences tools.test specialized-arrays alien.c-types ;
5 SPECIALIZED-ARRAY: double
6 IN: random.lagged-fibonacci.tests
7
8 { t } [
9     3 <lagged-fibonacci> [
10         1000 [ random-float ] double-array{ } replicate-as
11         999 swap nth 0.860072135925293 -.01 ~
12     ] with-random
13 ] unit-test
14
15 { t } [
16     3 <lagged-fibonacci> [
17         [
18             1000 [ random-float ] double-array{ } replicate-as
19         ] with-random
20     ] [
21         3 seed-random [
22             1000 [ random-float ] double-array{ } replicate-as
23         ] with-random =
24     ] bi
25 ] unit-test