]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/slots/syntax/syntax-tests.factor
Add copy-slots{ word to slots.syntax. Alias slots{ to get{ and set-slots{ to set...
[factor.git] / extra / slots / syntax / syntax-tests.factor
index e4dac6e4a4927425f0483714842352d8f1c81cd9..01335f54d12bd52091d675428966fb70ab39fe2b 100755 (executable)
@@ -1,14 +1,19 @@
 ! Copyright (C) 2010 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test slots.syntax ;
+USING: kernel tools.test slots.syntax ;
 IN: slots.syntax.tests
 
-TUPLE: slot-test a b c ;
+TUPLE: slot-test1 a b c ;
 
-[ 1 2 3 ] [ T{ slot-test f 1 2 3 } slots[ a b c ] ] unit-test
-[ 3 ] [ T{ slot-test f 1 2 3 } slots[ c ] ] unit-test
-[ ] [ T{ slot-test f 1 2 3 } slots[ ] ] unit-test
+[ 1 2 3 ] [ T{ slot-test1 f 1 2 3 } slots[ a b c ] ] unit-test
+[ 3 ] [ T{ slot-test1 f 1 2 3 } slots[ c ] ] unit-test
+[ ] [ T{ slot-test1 f 1 2 3 } slots[ ] ] unit-test
 
-[ { 1 2 3 } ] [ T{ slot-test f 1 2 3 } slots{ a b c } ] unit-test
-[ { 3 } ] [ T{ slot-test f 1 2 3 } slots{ c } ] unit-test
-[ { } ] [ T{ slot-test f 1 2 3 } slots{ } ] unit-test
+[ { 1 2 3 } ] [ T{ slot-test1 f 1 2 3 } slots{ a b c } ] unit-test
+[ { 3 } ] [ T{ slot-test1 f 1 2 3 } slots{ c } ] unit-test
+[ { } ] [ T{ slot-test1 f 1 2 3 } slots{ } ] unit-test
+
+TUPLE: slot-test2 a b c d ;
+
+[ T{ slot-test2 f 1 2 33 44 } ]
+[ 1 2 3 slot-test1 boa 11 22 33 44 slot-test2 boa copy-slots{ a b } ] unit-test