]> gitweb.factorcode.org Git - factor.git/blob - extra/fuel/fuel-tests.factor
functors: inline the parts of interpolate this needs
[factor.git] / extra / fuel / fuel-tests.factor
1 ! Copyright (C) 2009 Nicholas Seckar.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: continuations eval fuel fuel.private namespaces tools.test words ;
4 IN: fuel.tests
5
6 : fake-continuation ( -- continuation )
7     f f f "fake" f <continuation> ;
8
9 : make-uses-restart ( -- restart )
10     "Use the words vocabulary" \ word?
11     fake-continuation <restart> ;
12
13 : make-defer-restart ( -- restart )
14     "Defer word in current vocabulary" f
15     fake-continuation <restart> ;
16
17 { f } [ make-defer-restart is-use-restart? ] unit-test
18 { t } [ make-uses-restart is-use-restart? ] unit-test
19
20 { "words" } [ make-uses-restart get-restart-vocab ] unit-test
21
22 { f } [ make-defer-restart is-suggested-restart? ] unit-test
23 { f } [ make-uses-restart is-suggested-restart? ] unit-test
24 { f } [ { "io" } :uses-suggestions
25         [ make-uses-restart is-suggested-restart? ] with-variable
26 ] unit-test
27 { t } [ { "words" } :uses-suggestions
28         [ make-uses-restart is-suggested-restart? ] with-variable
29 ] unit-test
30
31 { f } [
32     { "kernel" } [ "\\ dup drop" eval( -- ) ] fuel-use-suggested-vocabs
33 ] unit-test