summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-09-29 17:52:33 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-09-29 17:52:33 -0700
commit32473f59a38631c4bb2403d835b9e007c8a0ddc7 (patch)
tree72df8959fcde37e5968a6c6301f8a98a9f860e5f /Test
parent60e31a45b0c015d42e9dc8ca2c991930c3f7fd66 (diff)
parent8cb67e721b3f02779bf4cf0d6a368f67c49c11f8 (diff)
downloadzsh-32473f59a38631c4bb2403d835b9e007c8a0ddc7.tar.gz
zsh-32473f59a38631c4bb2403d835b9e007c8a0ddc7.tar.xz
zsh-32473f59a38631c4bb2403d835b9e007c8a0ddc7.zip
Merge branch 'master' of git://git.code.sf.net/p/zsh/code
Conflicts:
	ChangeLog
Diffstat (limited to 'Test')
-rw-r--r--Test/A04redirect.ztst54
1 files changed, 53 insertions, 1 deletions
diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst
index 7ad02db3b..6c38a3194 100644
--- a/Test/A04redirect.ztst
+++ b/Test/A04redirect.ztst
@@ -54,7 +54,7 @@
 0:Here-documents stripping tabs
 >barbar
 
-  cat <<-$'$HERE '`$(THERE) `'$((AND)) '"\EVERYWHERE"
+  cat <<-$'$HERE '`$(THERE) `'$((AND)) '"\EVERYWHERE" #
 # tabs again.  sorry about the max miller.
 	Here's a funny thing.  Here is a funny thing.
 	I went home last night.  There's a funny thing.
@@ -455,3 +455,55 @@
 
   [</dev/null ]
 1:check behaviour with square brackets
+
+  print any old rubbish >input1
+  () {
+    local var
+    read var
+    print I just read $var
+  } <input1 >output1
+  print Nothing output yet
+  cat output1
+0:anonymous function redirections are applied immediately
+>Nothing output yet
+>I just read any old rubbish
+
+  redirfn() {
+    local var
+    read var
+    print I want to tell you about $var
+    print Also, this might be an error >&2
+  } <input2 >output2 2>&1
+  print something I heard on the radio >input2
+  redirfn
+  print No output until after this
+  cat output2
+0:redirections with normal function definition
+>No output until after this
+>I want to tell you about something I heard on the radio
+>Also, this might be an error
+
+  which redirfn
+0:text output of function with redirections
+>redirfn () {
+>	local var
+>	read var
+>	print I want to tell you about $var
+>	print Also, this might be an error >&2
+>} < input2 > output2 2>&1
+
+  1func 2func 3func() { print Ich heisse $0 } >output3
+  for i in 1 2 3; do
+    f=${i}func
+    print Running $f
+    $f
+    cat output3
+    unfunction $f
+  done
+0:multiply named functions with redirection
+>Running 1func
+>Ich heisse 1func
+>Running 2func
+>Ich heisse 2func
+>Running 3func
+>Ich heisse 3func