factor/core/compiler/tests/tuples.factor

33 lines
732 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
IN: temporary
USING: kernel tools.test compiler ;
TUPLE: color red green blue ;
[ T{ color f 1 2 3 } ]
2007-12-24 21:54:45 -05:00
[ 1 2 3 [ color construct-boa ] compile-call ] unit-test
2007-09-20 18:09:08 -04:00
[ 1 3 ] [
1 2 3 color construct-boa
2007-12-24 21:54:45 -05:00
[ { color-red color-blue } get-slots ] compile-call
2007-09-20 18:09:08 -04:00
] unit-test
[ T{ color f 10 2 20 } ] [
10 20
1 2 3 color construct-boa [
[
{ set-color-red set-color-blue } set-slots
2007-12-24 21:54:45 -05:00
] compile-call
2007-09-20 18:09:08 -04:00
] keep
] unit-test
[ T{ color f f f f } ]
2007-12-24 21:54:45 -05:00
[ [ color construct-empty ] compile-call ] unit-test
2007-09-20 18:09:08 -04:00
[ T{ color "a" f "b" f } ] [
"a" "b"
[ { set-delegate set-color-green } color construct ]
2007-12-24 21:54:45 -05:00
compile-call
2007-09-20 18:09:08 -04:00
] unit-test
2007-12-24 21:54:45 -05:00
[ T{ color f f f f } ] [ [ { } color construct ] compile-call ] unit-test