about summary refs log tree commit diff
path: root/Test/14array.ztst
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2000-06-02 01:35:54 +0000
committerWayne Davison <wayned@users.sourceforge.net>2000-06-02 01:35:54 +0000
commita5d9467cfa1420f91ba466a2bdcc3e4256f34433 (patch)
treee9f14908a3522239e60345bc8590b08d11ce5e9c /Test/14array.ztst
parentb40a5006c0f5b485e661d9b90f966c03ca7e6147 (diff)
downloadzsh-a5d9467cfa1420f91ba466a2bdcc3e4256f34433.tar.gz
zsh-a5d9467cfa1420f91ba466a2bdcc3e4256f34433.tar.xz
zsh-a5d9467cfa1420f91ba466a2bdcc3e4256f34433.zip
Some simple array indexing tests.
Diffstat (limited to 'Test/14array.ztst')
-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.