]> gitweb.factorcode.org Git - factor.git/commitdiff
named-tuples: few more test cases.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 18 Feb 2018 16:17:10 +0000 (08:17 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 18 Feb 2018 16:17:10 +0000 (08:17 -0800)
extra/named-tuples/named-tuples-tests.factor

index 7c8d61b8a7d2af9649d93cfc21bc8beb1e383c15..ea55cca72218519ac40c92cd1c958f4a3f5b6724 100644 (file)
@@ -1,4 +1,5 @@
-USING: arrays assocs math named-tuples sequences tools.test ;
+USING: arrays assocs classes.tuple kernel math named-tuples
+sequences tools.test ;
 IN: named-tuples.tests
 
 TUPLE: foo x y z ;
@@ -26,6 +27,10 @@ INSTANCE: foo named-tuple
 
 { f f } [ "not found" T{ foo f 1 2 3 } at* ] unit-test
 
+{ T{ foo f "x" 2 3 } } [ T{ foo f 1 2 3 } "x" dup pick set-at ] unit-test
+
+[ 1 "not found" T{ foo f 1 2 3 } set-at ] [ no-slot? ] must-fail-with
+
 { 1 } [ T{ foo f 1 2 3 } "x" of ] unit-test
 { 2 } [ T{ foo f 1 2 3 } "y" of ] unit-test
 { 3 } [ T{ foo f 1 2 3 } "z" of ] unit-test