factor/basis/compiler/tests/redefine5.factor

29 lines
767 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.redefine5
2008-08-29 18:53:00 -04:00
! Regression: if dispatch was eliminated but method was not inlined,
! compiled usage information was not recorded.
[ "compiler.tests.redefine5" forget-vocab ] with-compilation-unit
[ ] [
2009-09-20 23:42:40 -04:00
"USING: sorting kernel math.order ;
2008-08-29 18:53:00 -04:00
IN: compiler.tests.redefine5
GENERIC: my-generic ( a -- b )
M: object my-generic [ <=> ] sort ;
2009-09-20 23:42:40 -04:00
: my-inline ( a -- b ) my-generic ;"
eval( -- )
2008-08-29 18:53:00 -04:00
] unit-test
[ ] [
2009-09-20 23:42:40 -04:00
"USE: kernel
2008-08-29 18:53:00 -04:00
IN: compiler.tests.redefine5
TUPLE: my-tuple ;
2009-09-20 23:42:40 -04:00
M: my-tuple my-generic drop 0 ;" eval( -- )
2008-08-29 18:53:00 -04:00
] unit-test
[ 0 ] [
"my-tuple" "compiler.tests.redefine5" lookup boa
"my-inline" "compiler.tests.redefine5" lookup execute
] unit-test