about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Test/14array.ztst51
1 files changed, 51 insertions, 0 deletions
diff --git a/Test/14array.ztst b/Test/14array.ztst
new file mode 100644
index 000000000..ad02403e4
--- /dev/null
+++ b/Test/14array.ztst
@@ -0,0 +1,51 @@
+# 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.