about summary refs log tree commit diff
path: root/Test/D04parameter.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-09-14 10:32:29 +0100
committerPeter Stephenson <pws@zsh.org>2016-09-14 10:33:18 +0100
commita4b8ee13be494c8732c0348857befe87951a058b (patch)
tree5db582aeb688e4a1520f205a268765602f5b61e4 /Test/D04parameter.ztst
parentbe4c072cf50ffcc2e2c34e4edbb0e2a78900206b (diff)
downloadzsh-a4b8ee13be494c8732c0348857befe87951a058b.tar.gz
zsh-a4b8ee13be494c8732c0348857befe87951a058b.tar.xz
zsh-a4b8ee13be494c8732c0348857befe87951a058b.zip
zsh-users/21903: Fix ${...?...} in interactive shell.
On failure should abort back to top level, but we reset the error
flag around commands.  Add a hard error flag that's only reset at top level.
Diffstat (limited to 'Test/D04parameter.ztst')
-rw-r--r--Test/D04parameter.ztst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index be6e10461..762305197 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -95,6 +95,20 @@
 ?(eval):1: unset1: exiting1
 ?(eval):2: null1: exiting2
 
+  PROMPT="" $ZTST_testdir/../Src/zsh -fis <<<'
+  unsetopt PROMPT_SP
+  PS2="" PS3="" PS4="" RPS1="" RPS2=""
+  foo() {
+      print ${1:?no arguments given}
+      print not reached
+  }
+  foo
+  print reached
+  '
+0:interactive shell returns to top level on ${...?...} error
+?foo:1: 1: no arguments given
+>reached
+
   print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}
   print ${unset1:+word5} ${unset1+word6}
 0:${...:+...}, ${...+...}