about summary refs log tree commit diff
path: root/Test/ztst.zsh
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-05-29 14:50:28 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-05-29 14:50:28 +0000
commit52e5a75a7a8a4a16579e708a006f6346ce765aeb (patch)
treee4e6e92d27c96845720c36114e842cfbc92eef92 /Test/ztst.zsh
parent29b7123647bc3b70911bbb2caf85238d22d160c8 (diff)
downloadzsh-52e5a75a7a8a4a16579e708a006f6346ce765aeb.tar.gz
zsh-52e5a75a7a8a4a16579e708a006f6346ce765aeb.tar.xz
zsh-52e5a75a7a8a4a16579e708a006f6346ce765aeb.zip
23486: use {fd} syntax to get fd's for tests
Diffstat (limited to 'Test/ztst.zsh')
-rwxr-xr-xTest/ztst.zsh14
1 files changed, 9 insertions, 5 deletions
diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index bd76a0dc0..cc27c5791 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -147,10 +147,14 @@ $ZTST_failmsg"
 ZTST_verbose() {
   local lev=$1
   shift
-  [[ -n $ZTST_verbose && $ZTST_verbose -ge $lev ]] && print -r -- $* >&8
+  if [[ -n $ZTST_verbose && $ZTST_verbose -ge $lev ]]; then
+    print -r -u $ZTST_fd -- $*
+  fi
 }
 ZTST_hashmark() {
-  [[ ZTST_verbose -le 0 && -t 8 ]] && print -nu8 ${(pl:SECONDS::\#::\#\r:)}
+  if [[ ZTST_verbose -le 0 && -t $ZTST_fd ]]; then
+    print -n -u$ZTST_fd -- ${(pl:SECONDS::\#::\#\r:)}
+  fi
   (( SECONDS > COLUMNS+1 && (SECONDS -= COLUMNS) ))
 }
 
@@ -159,8 +163,8 @@ if [[ ! -r $ZTST_testname ]]; then
   exit 1
 fi
 
-exec 8>&1
-exec 9<$ZTST_testname
+exec {ZTST_fd}>&1
+exec {ZTST_input}<$ZTST_testname
 
 # The current line read from the test file.
 ZTST_curline=''
@@ -172,7 +176,7 @@ ZTST_cursect=''
 ZTST_getline() {
   local IFS=
   while true; do
-    read -r ZTST_curline <&9 || return 1
+    read -u $ZTST_input -r ZTST_curline || return 1
     [[ $ZTST_curline == \#* ]] || return 0
   done
 }