about summary refs log tree commit diff
path: root/Test/14array.ztst
blob: 7ff5fe13d98e7a8dfd32ac0428640ecbea34a611 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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.