summaryrefslogtreecommitdiff
path: root/Test/A04redirect.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2014-09-30 12:58:52 +0100
committerPeter Stephenson <pws@zsh.org>2014-09-30 12:58:52 +0100
commit0557c226fcd817ef21f91ed76e01db6e965b0709 (patch)
treeb8ec103f194b5027fa847d951a2060402125c5ea /Test/A04redirect.ztst
parent15222bcdcb3fddd897117ac08ed18d206fa383d1 (diff)
downloadzsh-0557c226fcd817ef21f91ed76e01db6e965b0709.tar.gz
zsh-0557c226fcd817ef21f91ed76e01db6e965b0709.zip
33294: $functions[func_with_redir] plus extra tests
Diffstat (limited to 'Test/A04redirect.ztst')
-rw-r--r--Test/A04redirect.ztst24
1 files changed, 24 insertions, 0 deletions
diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst
index 6c38a3194..a39ce46c8 100644
--- a/Test/A04redirect.ztst
+++ b/Test/A04redirect.ztst
@@ -507,3 +507,27 @@
>Ich heisse 2func
>Running 3func
>Ich heisse 3func
+
+ redirfn2() { print The latest output; } >&3
+ redirfn2 3>output4
+ print No output yet
+ cat output4
+0:Redirections in both function definition and command line
+>No output yet
+>The latest output
+
+# This relies on the fact that the test harness always loads
+# the zsh/parameter module.
+ print $functions[redirfn]
+0:Output from $functions[] for definition with redirection
+>{
+> local var
+> read var
+> print I want to tell you about $var
+> print Also, this might be an error >&2
+>} < input2 > output2 2>&1
+
+ noredirfn() { print This rather boring function has no redirection.; }
+ print $functions[noredirfn]
+0:Output from $functions[] for definition with no redirection
+> print This rather boring function has no redirection.