1 USING: compiler continuations io kernel math namespaces
2 prettyprint quotations random sequences vectors
4 USING: random-tester.databank random-tester.safe-words
12 ERROR: random-tester-error ;
14 : setup-test ( #data #code -- data... quot )
15 #! Variable stack effect
16 >r [ databank random ] times r>
17 ! 200 300 random-cond ;
19 [ drop \ safe-words get random ] map >quotation ;
21 : test-compiler ! ( data... quot -- ... )
24 datastack 1 head* before set
25 [ call ] [ drop ] recover
29 quot get [ compile-call ] [ errored on ] recover ;
31 : do-test ! ( data... quot -- )
32 .s flush test-compiler
34 datastack after get 2dup = [
45 : random-test1 ( #data #code -- )
49 3 2 setup-test do-test ;