about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-07-10 22:10:25 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-07-10 22:10:25 +0000
commit4db28c55b64ec25cd258f87a0d60b0544fe50059 (patch)
tree7e6c98c9aeae22faf5bc1bb06ff776da5edbf795 /Test
parentb4c2ea2cece1adeaa915f6c12f310f2268a58751 (diff)
downloadzsh-4db28c55b64ec25cd258f87a0d60b0544fe50059.tar.gz
zsh-4db28c55b64ec25cd258f87a0d60b0544fe50059.tar.xz
zsh-4db28c55b64ec25cd258f87a0d60b0544fe50059.zip
27126: a few more contexts where executing empty lists gives status zero
Diffstat (limited to 'Test')
-rw-r--r--Test/A01grammar.ztst22
-rw-r--r--Test/C04funcdef.ztst15
-rw-r--r--Test/D08cmdsubst.ztst4
3 files changed, 41 insertions, 0 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index b250d0984..1fe249869 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -27,6 +27,18 @@
   $nonexistent_variable
 0:Executing command that evaluates to empty resets status
 
+  false
+  sleep 1 &
+  print $?
+  # a tidy test is a happy test
+  wait $!
+0:Starting background command resets status
+>0
+
+  false
+  . /dev/null
+0:Sourcing empty file resets status
+
   fn() { local foo; read foo; print $foo; }
   coproc fn
   print -p coproc test output
@@ -531,3 +543,13 @@
   . ./bad_syntax
 126: Attempt to "." file with bad syntax.
 ?./bad_syntax:2: parse error near `\n'
+
+  echo 'false' >dot_false
+  . ./dot_false
+  print $?
+  echo 'true' >dot_true
+  . ./dot_true
+  print $?
+0:Last status of successfully executed "." file is retained
+>1
+>0
diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst
index 73eba8697..338c36fab 100644
--- a/Test/C04funcdef.ztst
+++ b/Test/C04funcdef.ztst
@@ -1,5 +1,20 @@
 %test
 
+  fn1() { return 1; }
+  fn2() {
+      fn1
+      print $?
+      return 2
+  }
+  fn2
+2:Basic status returns from functions
+>1
+
+  fnz() { }
+  false
+  fnz
+0:Empty function body resets status
+
   function f$$ () {
     print regress expansion of function names
   }
diff --git a/Test/D08cmdsubst.ztst b/Test/D08cmdsubst.ztst
index 015796ed6..1b5c7f728 100644
--- a/Test/D08cmdsubst.ztst
+++ b/Test/D08cmdsubst.ztst
@@ -89,3 +89,7 @@
   X=$(exit 2) $(exit 0) || print $?
 0:variable assignments processed after other substitutions
 >2
+
+ false
+ ``
+0:Empty command substitution resets status