]> gitweb.factorcode.org Git - factor.git/blob - core/compiler/test/tuples.factor
Initial import
[factor.git] / core / compiler / test / tuples.factor
1 IN: temporary
2 USING: kernel tools.test compiler ;
3
4 TUPLE: color red green blue ;
5
6 [ T{ color f 1 2 3 } ]
7 [ 1 2 3 [ color construct-boa ] compile-1 ] unit-test
8
9 [ 1 3 ] [
10     1 2 3 color construct-boa
11     [ { color-red color-blue } get-slots ] compile-1
12 ] unit-test
13
14 [ T{ color f 10 2 20 } ] [
15     10 20
16     1 2 3 color construct-boa [
17         [
18             { set-color-red set-color-blue } set-slots
19         ] compile-1
20     ] keep
21 ] unit-test
22
23 [ T{ color f f f f } ]
24 [ [ color construct-empty ] compile-1 ] unit-test
25
26 [ T{ color "a" f "b" f } ] [
27     "a" "b"
28     [ { set-delegate set-color-green } color construct ]
29     compile-1
30 ] unit-test
31
32 [ T{ color f f f f } ] [ [ { } color construct ] compile-1 ] unit-test