]> gitweb.factorcode.org Git - factor.git/blob - extra/slots/syntax/syntax-tests.factor
01335f54d12bd52091d675428966fb70ab39fe2b
[factor.git] / extra / slots / syntax / syntax-tests.factor
1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel tools.test slots.syntax ;
4 IN: slots.syntax.tests
5
6 TUPLE: slot-test1 a b c ;
7
8 [ 1 2 3 ] [ T{ slot-test1 f 1 2 3 } slots[ a b c ] ] unit-test
9 [ 3 ] [ T{ slot-test1 f 1 2 3 } slots[ c ] ] unit-test
10 [ ] [ T{ slot-test1 f 1 2 3 } slots[ ] ] unit-test
11
12 [ { 1 2 3 } ] [ T{ slot-test1 f 1 2 3 } slots{ a b c } ] unit-test
13 [ { 3 } ] [ T{ slot-test1 f 1 2 3 } slots{ c } ] unit-test
14 [ { } ] [ T{ slot-test1 f 1 2 3 } slots{ } ] unit-test
15
16 TUPLE: slot-test2 a b c d ;
17
18 [ T{ slot-test2 f 1 2 33 44 } ]
19 [ 1 2 3 slot-test1 boa 11 22 33 44 slot-test2 boa copy-slots{ a b } ] unit-test