Merge branch 'master' of git://factorcode.org/git/factor
[factor/jcg.git] / basis / compiler / tests / redefine3.factor
blobb25b5a1a5e2dabc37744a10a01fb3ed22f057984
1 IN: compiler.tests
2 USING: accessors compiler compiler.units tools.test math parser
3 kernel sequences sequences.private classes.mixin generic
4 definitions arrays words assocs eval ;
6 GENERIC: sheeple ( obj -- x )
8 M: object sheeple drop "sheeple" ;
10 MIXIN: empty-mixin
12 M: empty-mixin sheeple drop "wake up" ;
14 : sheeple-test ( -- string ) { } sheeple ;
16 [ "sheeple" ] [ sheeple-test ] unit-test
17 [ t ] [ \ sheeple-test optimized>> ] unit-test
18 [ t ] [ object \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
19 [ f ] [ empty-mixin \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
21 [ ] [ "IN: compiler.tests USE: arrays INSTANCE: array empty-mixin" eval ] unit-test
23 [ "wake up" ] [ sheeple-test ] unit-test
24 [ f ] [ object \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
25 [ t ] [ empty-mixin \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
27 [ ] [ [ array empty-mixin remove-mixin-instance ] with-compilation-unit ] unit-test
29 [ "sheeple" ] [ sheeple-test ] unit-test
30 [ t ] [ \ sheeple-test optimized>> ] unit-test
31 [ t ] [ object \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test
32 [ f ] [ empty-mixin \ sheeple method \ sheeple-test "compiled-uses" word-prop key? ] unit-test