about summary refs log tree commit diff
path: root/Test/D06subscript.ztst
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2008-03-18 15:14:20 +0000
committerBart Schaefer <barts@users.sourceforge.net>2008-03-18 15:14:20 +0000
commit4625e0eabc91d3e49404a6463e9ed8b2548b05b9 (patch)
treeedbf0602f65caaf44c8571dc905822db3f37bedf /Test/D06subscript.ztst
parent3cd59fa065f1cb1ecda54efdc05f96303c5647eb (diff)
downloadzsh-4625e0eabc91d3e49404a6463e9ed8b2548b05b9.tar.gz
zsh-4625e0eabc91d3e49404a6463e9ed8b2548b05b9.tar.xz
zsh-4625e0eabc91d3e49404a6463e9ed8b2548b05b9.zip
24717, 24718, 24719: a 0 subscript is neither valid nor equivalent to 1
any longer, so the (i) subscript flag on an empty array needs to yield 1.
Diffstat (limited to 'Test/D06subscript.ztst')
-rw-r--r--Test/D06subscript.ztst8
1 files changed, 6 insertions, 2 deletions
diff --git a/Test/D06subscript.ztst b/Test/D06subscript.ztst
index 6c9f477cc..4cb814977 100644
--- a/Test/D06subscript.ztst
+++ b/Test/D06subscript.ztst
@@ -178,11 +178,15 @@
 >lower
 >upper
 
-  typeset -a empty_array
-  echo X${${l##*}[-1]}X
+  typeset -ga empty
+  echo X${${empty##*}[-1]}X
 0:Negative index applied to substition result from empty array
 >XX
 
+  print $empty[(i)] $empty[(I)]
+0:(i) returns 1 for empty array, (I) returns 0.
+>1 0
+
   array=(one two three four)
   print X$array[0]X
 0:Element zero is empty if KSH_ZERO_SUBSCRIPT is off.