about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-12-01 14:22:55 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-12-01 14:22:55 +0000
commitc88084895d2b00f242082f47cbd5d3feef058eed (patch)
tree4173542aabe6fa55e90b5b2155014963ee517fb9
parent9d71f4c207fb34e8d64af0443c83231b1cc3b494 (diff)
downloadzsh-c88084895d2b00f242082f47cbd5d3feef058eed.tar.gz
zsh-c88084895d2b00f242082f47cbd5d3feef058eed.tar.xz
zsh-c88084895d2b00f242082f47cbd5d3feef058eed.zip
29923: work around test problem with invalid file descriptor message
-rw-r--r--ChangeLog7
-rw-r--r--Test/A04redirect.ztst24
2 files changed, 25 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1bff2da72..ae8cf1aba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-01  Peter Stephenson  <pws@csr.com>
+
+	* 29923: Test/A04redirect.ztst: work around variant message from
+	strerror() for invalid file descriptor.
+
 2011-11-30  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* Config/version.mk: 4.3.13 release.
@@ -15627,5 +15632,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5509 $
+* $Revision: 1.5510 $
 *****************************************************
diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst
index e58102664..838cb196d 100644
--- a/Test/A04redirect.ztst
+++ b/Test/A04redirect.ztst
@@ -153,17 +153,31 @@
 >goodbye
 
   (exec 3<&-
-  read foo <&-)
-1:'<&-' redirection
-?(eval):1: failed to close file descriptor 3: bad file descriptor
+  read foo <&-) 2>errmsg1.txt
+  mystat=$?
+  (( $mystat == 1 )) || print "Unexpected error status $mystat" >&2
+  input=("${(f)$(<errmsg1.txt)}")
+  if [[ ${#input} != 1 || \
+        $input[1] !=   "(eval):1: failed to close file descriptor 3:"* ]];
+  then
+    print "Unexpected error output:\n$input" >&2
+  fi
+0:'<&-' redirection
 
   print foo >&-
 0:'>&-' redirection
 
   (exec >&-
-  print foo)
+  print foo) 2>errmsg2.txt
+  mystat=$?
+  (( $mystat == 0 )) || print "Unexpected error status $mystat" >&2
+  input=("${(f)$(<errmsg2.txt)}")
+  if [[ ${#input} != 1 || \
+        $input[1] !=   "(eval):2: write error:"* ]];
+  then
+    print "Unexpected error output:\n$input" >&2
+  fi
 0:'>&-' with attempt to use closed fd
-?(eval):2: write error: bad file descriptor
 
   fn() { local foo; read foo; print $foo; }
   coproc fn