named-tuples: few more test cases.
parent
a3e1364c4f
commit
1c59001abc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue