about summary refs log tree commit diff
path: root/Test/D06subscript.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-11-17 17:44:12 +0000
committerPeter Stephenson <pws@zsh.org>2015-11-17 17:44:12 +0000
commitca0cb170119b3cef4ccdfc743b6c225e9e6eed53 (patch)
treef4734b1bd2ae78daabe9eb97b202b9703cea7681 /Test/D06subscript.ztst
parentbc543abbf6e90ea8678b97cc36732e6f94bbe199 (diff)
downloadzsh-ca0cb170119b3cef4ccdfc743b6c225e9e6eed53.tar.gz
zsh-ca0cb170119b3cef4ccdfc743b6c225e9e6eed53.tar.xz
zsh-ca0cb170119b3cef4ccdfc743b6c225e9e6eed53.zip
37128: work around alias expansion trashing subscript parsing
Diffstat (limited to 'Test/D06subscript.ztst')
-rw-r--r--Test/D06subscript.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/D06subscript.ztst b/Test/D06subscript.ztst
index cffca742e..144923667 100644
--- a/Test/D06subscript.ztst
+++ b/Test/D06subscript.ztst
@@ -249,3 +249,20 @@
   string[0]=!
 1:Can't set only element zero of string
 ?(eval):1: string: assignment to invalid subscript range
+
+  typeset -A assoc=(leader topcat officer dibble sidekick choochoo)
+  alias myind='echo leader' myletter='echo 1' myletter2='echo 4'
+  print ${assoc[$(myind)]}
+  print $assoc[$(myind)]
+  print ${assoc[$(myind)][$(myletter)]}${assoc[$(myind)][$(myletter2)]}
+  assoc[$(myind)]='of the gang'
+  print ${assoc[$(myind)]}
+  print $assoc[$(myind)]
+  print $assoc[leader]
+0: Parsing subscript with non-trivial tokenisation
+>topcat
+>topcat
+>tc
+>of the gang
+>of the gang
+>of the gang