]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tests/folding.factor
Rename lookup to lookup-word.
[factor.git] / basis / compiler / tests / folding.factor
1 USING: eval tools.test compiler.units vocabs words
2 kernel classes.mixin arrays ;
3 IN: compiler.tests.folding
4
5 ! Calls to generic words were not folded away.
6
7 [ ] [ [ "compiler.tests.redefine11" forget-vocab ] with-compilation-unit ] unit-test
8
9 [ ] [
10     "USING: math arrays ;
11     IN: compiler.tests.folding
12     GENERIC: foldable-generic ( a -- b ) foldable
13     M: integer foldable-generic f <array> ;"
14     eval( -- )
15 ] unit-test
16
17 [ ] [
18     "USING: math arrays ;
19     IN: compiler.tests.folding
20     : fold-test ( -- x ) 10 foldable-generic ;"
21     eval( -- )
22 ] unit-test
23
24 [ t ] [
25     "fold-test" "compiler.tests.folding" lookup-word execute
26     "fold-test" "compiler.tests.folding" lookup-word execute
27     eq?
28 ] unit-test