about summary refs log tree commit diff
path: root/Test/D04parameter.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-10-09 13:46:45 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-10-09 13:46:45 +0000
commitad3e2aa2157bc779b596d95987a80b28cf6928b9 (patch)
treead186c4074d05c1b96832aac9c3c72c1def35e0d /Test/D04parameter.ztst
parent86ef4650dccad8dfa00f28c94296dae1ec13d84e (diff)
downloadzsh-ad3e2aa2157bc779b596d95987a80b28cf6928b9.tar.gz
zsh-ad3e2aa2157bc779b596d95987a80b28cf6928b9.tar.xz
zsh-ad3e2aa2157bc779b596d95987a80b28cf6928b9.zip
25831: fix empty return values from subscript matches with RC_EXPAND_PARAM
Diffstat (limited to 'Test/D04parameter.ztst')
-rw-r--r--Test/D04parameter.ztst34
1 files changed, 34 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 376932b34..4cd137bbd 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -1086,3 +1086,37 @@
 >no
 >no
 >no
+
+  rcexbug() {
+    emulate -L zsh
+    setopt rcexpandparam
+    local -A hash
+    local -a full empty
+    full=(X x)
+    hash=(X x)
+    print ORDINARY ARRAYS
+    : The following behaves as documented in zshoptions
+    print FULL expand=$full
+    : Empty arrays remove the adjacent argument
+    print EMPTY expand=$empty
+    print ASSOCIATIVE ARRAY
+    print Subscript flags returning many values
+    print FOUND key=$hash[(I)X] val=$hash[(R)x]
+    : This should behave like $empty, and does
+    print LOST key=$hash[(I)y] val=$hash[(R)Y]
+    print Subscript flags returning single values
+    : Doc says "substitutes ... empty string"
+    : so must not behave like an empty array
+    print STRING key=$hash[(i)y] val=$hash[(r)Y]
+  }
+  rcexbug
+0:Lookup failures on elements of arrays with RC_EXPAND_PARAM
+>ORDINARY ARRAYS
+>FULL expand=X expand=x
+>EMPTY
+>ASSOCIATIVE ARRAY
+>Subscript flags returning many values
+>FOUND key=X val=x
+>LOST
+>Subscript flags returning single values
+>STRING key= val=