3 # Copyright (C) 2006-2007, The Perl Foundation.
8 use lib qw(APL . lib ../lib ../../lib ../../../lib);
9 use t::APL tests => 44;
15 === simple vector parsing
19 === simple vector parsing, with negatives.
31 --- APL: 1 2 3 5 7 9 11⍳7
34 === index of, scalar, not found
35 --- APL: 1 2 3 5 7 9 11⍳3.14
39 --- APL: 1 2 3 5 7 9 11⍳7 3 9 10
46 === index of, alpha, multiple
47 --- APL: 'ALPHABETICAL'⍳'CAB'
50 === index of, not found
58 === reverse, characters
59 --- APL: ⌽'APL IS WIERD'
66 === rotate multiple positions
79 --- APL: 3⊖'QWERTYUIOP'
82 === rotate characters, backwards.
83 --- APL: ⁻3⊖'QWERTYUIOP'
86 === rotate characters, but don't
87 --- APL: 0⊖'QWERTYUIOP'
90 === without, characters
91 --- APL: 'APL ON PARROT'~'AEIOU '
95 --- APL: 1 2 3 4 5 6 7 8 9~1 3 5 7 9
103 --- APL: 5↑'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
106 === take, characters, negative
107 --- APL: ⁻5↑'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
110 === take, simple vector
114 === take, simple vector, negative
116 --- out: 16 17 18 19 20
119 --- APL: 5↓'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
120 --- out: FGHIJKLMNOPQRSTUVWXYZ
122 === drop, characters, negative
123 --- APL: ⁻5↓'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
124 --- out: ABCDEFGHIJKLMNOPQRSTU
126 === drop, simple vector
128 --- out: 6 7 8 9 10 11
130 === drop, simple vector, negative
134 === shape, characters
141 === shape of shape of scalar
159 === reshape, numeric vector (verify resulting shape)
164 === reshape, numeric vector
170 === reshape, numeric vector, too few elements.
176 === reshape, numeric vector, too many elements.
182 === reshape, character vector
183 --- APL: 2 3⍴'ABCDEF'
188 === reshape, character vector, too few elements
194 === reshape, character vector, too many elements
195 --- APL: 2 3⍴'ABCDEFGHIJKL'
200 === use reshape to create a single-element vector