From fd679250cc4359fb792622d3db642ff6aea87e07 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 17 Feb 2006 18:29:57 +0000 Subject: 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. --- Test/D04parameter.ztst | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index c02019db5..73e87d0f8 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -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 -- cgit 1.4.1