diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2010-12-21 16:54:30 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2010-12-21 16:54:30 +0000 |
commit | bc1a12f91e83488c8e46789bdaedf28090829a3a (patch) | |
tree | 85fa80981b280027a94b36d8f8afece1d81e7dd8 /Test | |
parent | d3ec328926fd85ec846c47aa996bbee1d3e24f06 (diff) | |
download | zsh-bc1a12f91e83488c8e46789bdaedf28090829a3a.tar.gz zsh-bc1a12f91e83488c8e46789bdaedf28090829a3a.tar.xz zsh-bc1a12f91e83488c8e46789bdaedf28090829a3a.zip |
users/15662: array slice assignment with one index positive and one negative.
Diffstat (limited to 'Test')
-rw-r--r-- | Test/A06assign.ztst | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Test/A06assign.ztst b/Test/A06assign.ztst index 46b38359a..84500f605 100644 --- a/Test/A06assign.ztst +++ b/Test/A06assign.ztst @@ -104,7 +104,29 @@ 0:Replacement off start doesn't leave gaps. Hope this is right. >43 1 2 3 4 5 -# TODO: mixed indices [-num,num] and [num,-num] + array=(1 2 3 4 5) + array[1,-1]=(42 43) + print $array + array[-3,3]=(1 2 3 4 5) + print $array +0:Replacement of entire array, mixed indices +>42 43 +>1 2 3 4 5 + + array=(1 2 3 4 5) + array[-7,7]=(42 43) + print $array +0:Replacement of more than entire array, mixed indices +>42 43 + + array=(1 2 3 4 5) + array[3,-2]=(42 43 44) + print $array + array[-3,5]=(100 99) + print $array +0:Replacement of slice in middle, mixed indices +>1 2 42 43 44 5 +>1 2 42 100 99 5 # tests of var+=scalar |