about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2006-02-17 18:29:57 +0000
committerWayne Davison <wayned@users.sourceforge.net>2006-02-17 18:29:57 +0000
commitfd679250cc4359fb792622d3db642ff6aea87e07 (patch)
tree92ea5e78461ed12a2ae6175263f27ddd32d7f4c7
parent16916cd849880908d70fc53dbd179814460dba13 (diff)
downloadzsh-fd679250cc4359fb792622d3db642ff6aea87e07.tar.gz
zsh-fd679250cc4359fb792622d3db642ff6aea87e07.tar.xz
zsh-fd679250cc4359fb792622d3db642ff6aea87e07.zip
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.
-rw-r--r--Test/D04parameter.ztst23
1 files changed, 22 insertions, 1 deletions
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