]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tests/redefine7.factor
merge project-euler.factor
[factor.git] / basis / compiler / tests / redefine7.factor
1 USING: eval tools.test compiler.units vocabs words
2 kernel ;
3 IN: compiler.tests.redefine7
4
5 ! Mixin redefinition did not recompile all necessary words.
6
7 [ ] [ [ "compiler.tests.redefine7" forget-vocab ] with-compilation-unit ] unit-test
8
9 [ ] [
10     "USING: kernel math ;
11     IN: compiler.tests.redefine7
12     MIXIN: my-mixin
13     INSTANCE: fixnum my-mixin
14     : my-inline ( a -- b ) dup my-mixin? [ 1 + ] when ;"
15     eval( -- )
16 ] unit-test
17
18 [ ] [
19     "USE: math
20     IN: compiler.tests.redefine7
21     INSTANCE: float my-mixin"
22     eval( -- )
23 ] unit-test
24
25 [ 2.0 ] [
26     1.0 "my-inline" "compiler.tests.redefine7" lookup execute
27 ] unit-test