]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tests/redefine17.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / compiler / tests / redefine17.factor
1 USING: tools.test classes.mixin compiler.units arrays kernel.private
2 strings sequences vocabs definitions kernel ;
3 IN: compiler.tests.redefine17
4
5 << "compiler.tests.redefine17" words forget-all >>
6
7 GENERIC: bong ( a -- b )
8
9 M: array bong ;
10
11 M: string bong length ;
12
13 MIXIN: mixin
14
15 INSTANCE: array mixin
16
17 : blah ( a -- b ) { mixin } declare bong ;
18
19 [ { } ] [ { } blah ] unit-test
20
21 [ ] [ [ \ array \ mixin remove-mixin-instance ] with-compilation-unit ] unit-test
22
23 [ ] [ [ \ string \ mixin add-mixin-instance ] with-compilation-unit ] unit-test
24
25 [ 0 ] [ "" blah ] unit-test
26
27 MIXIN: mixin1
28
29 INSTANCE: string mixin1
30
31 MIXIN: mixin2
32
33 GENERIC: billy ( a -- b )
34
35 M: mixin2 billy ;
36
37 M: array billy drop "BILLY" ;
38
39 INSTANCE: string mixin2
40
41 : bully ( a -- b ) { mixin1 } declare billy ;
42
43 [ "" ] [ "" bully ] unit-test
44
45 [ ] [ [ \ string \ mixin1 remove-mixin-instance ] with-compilation-unit ] unit-test
46
47 [ ] [ [ \ array \ mixin1 add-mixin-instance ] with-compilation-unit ] unit-test
48
49 [ "BILLY" ] [ { } bully ] unit-test