mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-01 06:20:55 +01:00
Make sure that the (A) assignment of a single-item array retains
its arrayness. Also ensure that the array/scalar type of each assigned variable is correct.
This commit is contained in:
parent
16916cd849
commit
fd679250cc
1 changed files with 22 additions and 1 deletions
|
|
@ -224,14 +224,31 @@
|
|||
>second line
|
||||
>third line
|
||||
|
||||
array1=( uno )
|
||||
print -l ${(A)newarray=splitting by numbers}
|
||||
print -l ${(t)newarray}
|
||||
print -l ${(A)=newarray::=splitting by spaces, actually}
|
||||
0:${(A)...=...}, ${(A)...::=...}
|
||||
print -l ${(t)newarray}
|
||||
print -l ${(A)newarray::=$array1}
|
||||
print -l ${(t)newarray}
|
||||
print -l ${newarray::=$array1}
|
||||
print -l ${(t)newarray}
|
||||
print -l ${newarray::=$array2}
|
||||
print -l ${(t)newarray}
|
||||
0:${(A)...=...}, ${(A)...::=...}, ${scalar=$array}
|
||||
>splitting by numbers
|
||||
>array
|
||||
>splitting
|
||||
>by
|
||||
>spaces,
|
||||
>actually
|
||||
>array
|
||||
>uno
|
||||
>array
|
||||
>uno
|
||||
>scalar
|
||||
>the second array
|
||||
>scalar
|
||||
|
||||
newarray=("split me" "split me" "I\'m yours")
|
||||
print -l "${(@)newarray}"
|
||||
|
|
@ -539,9 +556,11 @@
|
|||
|
||||
set If "this test fails" "we have broken" the shell again
|
||||
print -l "${(A)foo::=$@}"
|
||||
print -l ${(t)foo}
|
||||
print -l $foo
|
||||
0:Regression test of "${(A)foo=$@}" bug
|
||||
>If this test fails we have broken the shell again
|
||||
>array
|
||||
>If
|
||||
>this test fails
|
||||
>we have broken
|
||||
|
|
@ -555,6 +574,7 @@
|
|||
set Make $sure_that "this test keeps" on 'preserving all' "$varieties_of" quoted whitespace
|
||||
print -l ${=1+"$@"}
|
||||
print -l ${(A)=foo=Make $sure_that "this test keeps" on 'preserving all' "$varieties_of" quoted whitespace}
|
||||
print ${(t)foo}
|
||||
print -l ${=1+$one $two}
|
||||
print -l ${1+$extra$two$one}
|
||||
0:Regression test of ${=1+"$@"} bug and some related expansions
|
||||
|
|
@ -575,6 +595,7 @@
|
|||
>varieties of
|
||||
>quoted
|
||||
>whitespace
|
||||
>array
|
||||
>1
|
||||
>2
|
||||
>5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue