mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-03 09:21:19 +02:00
56 lines
584 B
Plaintext
56 lines
584 B
Plaintext
# Tests for array indexing
|
|
|
|
%prep
|
|
|
|
foo=(a b c d e f g)
|
|
|
|
%test
|
|
|
|
echo .$foo[1,4].
|
|
0:Array indexing
|
|
>.a b c d.
|
|
|
|
echo .$foo[1,-5].
|
|
0:Array indexing
|
|
>.a b c.
|
|
|
|
echo .$foo[4,1].
|
|
0:Array indexing
|
|
>..
|
|
|
|
echo .$foo[0,0].
|
|
0:Array indexing
|
|
>.a.
|
|
|
|
echo .$foo[0].
|
|
0:Array indexing
|
|
>.a.
|
|
|
|
echo .$foo[1].
|
|
0:Array indexing
|
|
>.a.
|
|
|
|
echo .$foo[3].
|
|
0:Array indexing
|
|
>.c.
|
|
|
|
echo .$foo[0,1].
|
|
0:Array indexing
|
|
>.a.
|
|
|
|
echo .$foo[2,2].
|
|
0:Array indexing
|
|
>.b.
|
|
|
|
echo .$foo[1,0].
|
|
0:Array indexing
|
|
>..
|
|
|
|
echo .$foo[-4,5].
|
|
0:Array indexing
|
|
>.d e.
|
|
|
|
echo .$foo[-6,-2].
|
|
0:Array indexing
|
|
>.b c d e f.
|