1 USING: tools.test classes.mixin compiler.units arrays kernel.private
2 strings sequences vocabs definitions kernel ;
3 IN: compiler.tests.redefine17
5 << "compiler.tests.redefine17" vocab-words forget-all >>
7 GENERIC: bong ( a -- b )
11 M: string bong length ;
17 : blah ( a -- b ) { mixin } declare bong ;
19 { { } } [ { } blah ] unit-test
21 { } [ [ \ array \ mixin remove-mixin-instance ] with-compilation-unit ] unit-test
23 { } [ [ \ string \ mixin add-mixin-instance ] with-compilation-unit ] unit-test
25 { 0 } [ "" blah ] unit-test
29 INSTANCE: string mixin1
33 GENERIC: billy ( a -- b )
37 M: array billy drop "BILLY" ;
39 INSTANCE: string mixin2
41 : bully ( a -- b ) { mixin1 } declare billy ;
43 { "" } [ "" bully ] unit-test
45 { } [ [ \ string \ mixin1 remove-mixin-instance ] with-compilation-unit ] unit-test
47 { } [ [ \ array \ mixin1 add-mixin-instance ] with-compilation-unit ] unit-test
49 { "BILLY" } [ { } bully ] unit-test