about summary refs log tree commit diff
path: root/Test/A06assign.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/A06assign.ztst')
-rw-r--r--Test/A06assign.ztst35
1 files changed, 35 insertions, 0 deletions
diff --git a/Test/A06assign.ztst b/Test/A06assign.ztst
index fd2b4177c..f89edb888 100644
--- a/Test/A06assign.ztst
+++ b/Test/A06assign.ztst
@@ -199,6 +199,41 @@
 >a 1 2 3
 >a 1 2 3
 
+# tests of array assignment using lastval ($?)
+
+  true
+  array=( $? )
+  print $array
+0:Assign $? to array (true)
+>0
+
+  false
+  array=( $? )
+  print $array
+0:Assign $? to array (false)
+>1
+
+  true
+  typeset array=( $? )
+  print $array
+0:Assign $? to array with typeset (true)
+>0
+
+  false
+  typeset array=( $? )
+  print $array
+0:Assign $? to array with typeset (false)
+>1
+
+  array=( )
+  true
+  array+=( $? )
+  false
+  array+=( $? )
+  print $array
+0:Append $? to array (true+false)
+>0 1
+
 # tests of var+=scalar
 
  s+=foo