factor/basis/compiler/tests/redefine6.factor

32 lines
812 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.redefine6
! Mixin redefinition did not recompile all necessary words.
[ ] [ [ "compiler.tests.redefine6" forget-vocab ] with-compilation-unit ] unit-test
[ ] [
2009-09-20 23:42:40 -04:00
"USING: kernel kernel.private ;
IN: compiler.tests.redefine6
GENERIC: my-generic ( a -- b )
MIXIN: my-mixin
M: my-mixin my-generic drop 0 ;
2009-09-20 23:42:40 -04:00
: my-inline ( a -- b ) { my-mixin } declare my-generic ;"
eval( -- )
] unit-test
[ ] [
2009-09-20 23:42:40 -04:00
"USING: kernel ;
IN: compiler.tests.redefine6
TUPLE: my-tuple ;
M: my-tuple my-generic drop 1 ;
2009-09-20 23:42:40 -04:00
INSTANCE: my-tuple my-mixin"
eval( -- )
] unit-test
[ 1 ] [
2011-11-06 18:57:24 -05:00
"my-tuple" "compiler.tests.redefine6" lookup-word boa
"my-inline" "compiler.tests.redefine6" lookup-word execute
] unit-test