Add test case for mixin bug Doug found, seems to be fixed now

release
Slava Pestov 2010-01-20 20:27:10 +13:00
parent af41dc6169
commit d58f73453f
1 changed files with 25 additions and 0 deletions
basis/compiler/tests

View File

@ -0,0 +1,25 @@
USING: kernel tools.test eval words ;
IN: compiler.tests.redefine18
! Mixin bug found by Doug
GENERIC: g1 ( a -- b )
GENERIC: g2 ( a -- b )
MIXIN: c
SINGLETON: a
INSTANCE: a c
M: c g1 g2 ;
M: a g2 drop a ;
MIXIN: d
INSTANCE: d c
M: d g2 drop d ;
[ ] [ "IN: compiler.tests.redefine18 SINGLETON: b INSTANCE: b d" eval( -- ) ] unit-test
[ d ] [ "b" "compiler.tests.redefine18" lookup g1 ] unit-test
[ ] [ "IN: compiler.tests.redefine18 FORGET: b" eval( -- ) ] unit-test