factor/basis/compiler/tests/redefine7.factor

28 lines
637 B
Factor
Raw Normal View History

2009-09-20 23:42:40 -04:00
USING: eval tools.test compiler.units vocabs words
kernel ;
2009-04-26 01:51:47 -04:00
IN: compiler.tests.redefine7
! Mixin redefinition did not recompile all necessary words.
[ ] [ [ "compiler.tests.redefine7" forget-vocab ] with-compilation-unit ] unit-test
[ ] [
2009-09-20 23:42:40 -04:00
"USING: kernel math ;
IN: compiler.tests.redefine7
MIXIN: my-mixin
INSTANCE: fixnum my-mixin
2009-09-20 23:42:40 -04:00
: my-inline ( a -- b ) dup my-mixin? [ 1 + ] when ;"
eval( -- )
] unit-test
[ ] [
2009-09-20 23:42:40 -04:00
"USE: math
IN: compiler.tests.redefine7
2009-09-20 23:42:40 -04:00
INSTANCE: float my-mixin"
eval( -- )
] unit-test
[ 2.0 ] [
2011-11-06 18:57:24 -05:00
1.0 "my-inline" "compiler.tests.redefine7" lookup-word execute
] unit-test