summaryrefslogtreecommitdiffstats
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-02-09 16:39:29 +0000
committerPeter Stephenson <pws@zsh.org>2015-02-09 16:39:29 +0000
commitda86d6b4f2c3eef5b1f0860c9dae433f3a540951 (patch)
tree962816f299b49fe713b15c974b97a65239093ebd /Test/E01options.ztst
parent34466: Fix double unmeta in rm verification (diff)
downloadzsh-da86d6b4f2c3eef5b1f0860c9dae433f3a540951.tar
zsh-da86d6b4f2c3eef5b1f0860c9dae433f3a540951.tar.gz
zsh-da86d6b4f2c3eef5b1f0860c9dae433f3a540951.tar.bz2
zsh-da86d6b4f2c3eef5b1f0860c9dae433f3a540951.tar.lz
zsh-da86d6b4f2c3eef5b1f0860c9dae433f3a540951.tar.xz
zsh-da86d6b4f2c3eef5b1f0860c9dae433f3a540951.tar.zst
zsh-da86d6b4f2c3eef5b1f0860c9dae433f3a540951.zip
34485: More rationalisation for anonymous functions.
Don't attempt to treat as "simple" case as there are too many hidden problems. Pull out some post-execution functions to a common case in execcmd().
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst26
1 files changed, 18 insertions, 8 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 46b183776..32135344f 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -783,14 +783,24 @@
>print is a shell builtin
?(eval):8: command not found: print
-# This option seems to be problematic. I don't quite know how it works.
-## func() {
-## setopt localoptions printexitvalue
-## false
-## }
-## func
-## 1:PRINT_EXIT_VALUE option
-## ?(eval):2: exit 1
+# PRINTEXITVALUE only works if shell input is coming from standard input.
+# Goodness only knows why.
+ $ZTST_testdir/../Src/zsh -f <<<'
+ setopt printexitvalue
+ func() {
+ false
+ }
+ func
+ '
+1:PRINT_EXIT_VALUE option
+?zsh: exit 1
+
+ $ZTST_testdir/../Src/zsh -f <<<'
+ setopt printexitvalue
+ () { false; }
+ '
+1:PRINT_EXIT_VALUE option for anonymous function
+?zsh: exit 1
setopt promptbang
print -P !