1 USING: specialized-arrays sequences.complex
2 kernel sequences tools.test arrays accessors ;
3 SPECIALIZED-ARRAY: float
4 IN: sequences.complex.tests
7 float-array{ 1.0 2.0 3.0 4.0 } clone <complex-sequence> ;
8 : odd-length-test-array ( -- x )
9 float-array{ 1.0 2.0 3.0 4.0 5.0 } clone <complex-sequence> ;
11 [ 2 ] [ test-array length ] unit-test
12 [ 2 ] [ odd-length-test-array length ] unit-test
14 [ C{ 1.0 2.0 } ] [ test-array first ] unit-test
15 [ C{ 3.0 4.0 } ] [ test-array second ] unit-test
17 [ { C{ 1.0 2.0 } C{ 3.0 4.0 } } ]
18 [ test-array >array ] unit-test
20 [ float-array{ 1.0 2.0 5.0 6.0 } ]
21 [ test-array [ C{ 5.0 6.0 } 1 rot set-nth ] [ seq>> ] bi ]
24 [ float-array{ 7.0 0.0 3.0 4.0 } ]
25 [ test-array [ 7.0 0 rot set-nth ] [ seq>> ] bi ]