]> gitweb.factorcode.org Git - factor.git/blob - core/compiler/test/generic.factor
Initial import
[factor.git] / core / compiler / test / generic.factor
1 IN: temporary
2 USING: compiler generic tools.test math kernel words arrays
3 sequences quotations ;
4
5 GENERIC: single-combination-test
6
7 M: object single-combination-test drop ;
8 M: f single-combination-test nip ;
9 M: array single-combination-test drop ;
10 M: integer single-combination-test drop ;
11
12 [ 2 3 ] [ 2 3 t single-combination-test ] unit-test
13 [ 2 3 ] [ 2 3 4 single-combination-test ] unit-test
14 [ 2 f ] [ 2 3 f single-combination-test ] unit-test
15
16 DEFER: single-combination-test-2
17
18 : single-combination-test-4
19     dup [ single-combination-test-2 ] when ;
20
21 : single-combination-test-3
22     drop 3 ;
23
24 GENERIC: single-combination-test-2
25 M: object single-combination-test-2 single-combination-test-3 ;
26 M: f single-combination-test-2 single-combination-test-4 ;
27
28 [ 3 ] [ t single-combination-test-2 ] unit-test
29 [ 3 ] [ 3 single-combination-test-2 ] unit-test
30 [ f ] [ f single-combination-test-2 ] unit-test