Merge branch 'master' of git://factorcode.org/git/factor
[factor/jcg.git] / basis / sequences / complex-components / complex-components-tests.factor
blobf0c8e92c6ea59d0ac004c10958abbb1b56c5f5b2
1 USING: sequences.complex-components
2 kernel sequences tools.test arrays accessors ;
3 IN: sequences.complex-components.tests
5 : test-array ( -- x )
6     { C{ 1.0 2.0 } 3.0 C{ 5.0 6.0 } } <complex-components> ;
8 [ 6 ] [ test-array length ] unit-test
10 [ 1.0 ] [ test-array first  ] unit-test
11 [ 2.0 ] [ test-array second ] unit-test
12 [ 3.0 ] [ test-array third  ] unit-test
13 [ 0   ] [ test-array fourth ] unit-test
15 [ { 1.0 2.0 3.0 0 5.0 6.0 } ] [ test-array >array ] unit-test