diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2026-06-19 21:33:34 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2026-06-21 09:26:14 +0200 |
| commit | c4e0b3cfd15a82261295dad8c242b874079ae79c (patch) | |
| tree | d9b0f8a28ac99880133259a7edc1721d85f2b600 /Test | |
| parent | 54790 (tweaked): _ffmpeg: update for modern ffmpeg (diff) | |
| download | zsh-c4e0b3cfd15a82261295dad8c242b874079ae79c.tar zsh-c4e0b3cfd15a82261295dad8c242b874079ae79c.tar.gz zsh-c4e0b3cfd15a82261295dad8c242b874079ae79c.tar.bz2 zsh-c4e0b3cfd15a82261295dad8c242b874079ae79c.tar.lz zsh-c4e0b3cfd15a82261295dad8c242b874079ae79c.tar.xz zsh-c4e0b3cfd15a82261295dad8c242b874079ae79c.tar.zst zsh-c4e0b3cfd15a82261295dad8c242b874079ae79c.zip | |
54822: the ::= fix in 54674 was incomplete
% foo=xxx; () { echo ${2::=$foo} } yyy
yyy
We get the argv parameter returned when asking for "2" so use getvalue()
to get a vbuf with the proper start/end set instead of making up bogus
values.
Diffstat (limited to 'Test')
| -rw-r--r-- | Test/D04parameter.ztst | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 97577fd4e..d6e0044ef 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -84,16 +84,55 @@ typeset -Z3 zerothree print ${zerothree::=15} + zerothree= + print ${zerothree[1]::=2} $zerothree[1] $zerothree + zerothree= + print ${zerothree[1,2]::=34} $zerothree[1,2] $zerothree + zerothree= + print ${zerothree[2,3]::=7} $zerothree[2,3] $zerothree typeset -E3 ethree five=5 print ${ethree::=five} typeset -a -U uniquearr typeset -a duplicates=(1 2 1 1 2 3) print ${(A)uniquearr::=$duplicates} + print ${(A)uniquearr[1,2]::=$duplicates} + typeset -a normalarray=( a b c d e ) + print ${(A)normalarray[2,4]::=o} + typeset -u upper=aaaaa + print ${upper[2,3]::=hi} $upper $upper[2,3] + print ${(A)upper::=big} $upper ${(t)upper} 0:::= respects expansion flags >015 +>0 0 002 +>03 03 034 +>07 07 007 >5.00e+00 >1 2 3 +>1 2 +>o e +>HI AHIAA HI +>big big array-local + + local foo=xxx + () { echo ${2::=$foo} ${3::=$foo} ${4::=$foo}; echo $2 } yyy + () { echo ${11::=$foo}; echo $11 } yyy blah +0:::= doesn't do weird things with positional arguments +>xxx xxx xxx +>xxx +>xxx +>xxx + + local five=5 arr=( a b ) + print -rl - ${arr[2]::=$five} + () { print -rl - ${1::=$2} } x y + () { print -rl - ${1::=$five} ${2::=$five} ${9::=$five} } x y +0:regression: ::= with multiple assignments +>5 +>y +>5 +>5 +>5 unset array print ${#${(A)=array=word}} |
