From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Tests RE behavior of ERR_EXIT
Date: Tue, 8 Nov 2022 21:29:28 -0800 [thread overview]
Message-ID: <CAH+w=7Z0zT8Lq5BKe4M-JzdjOYhQsmnHJZTVQ7V5+wLBd5u=zA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 318 bytes --]
Changed a set of tests from success to xfail. Anyone have ideas of
why these aren't working?
If I change the ( subshell ) constructs to use
$ZTST_testdir/../Src/zsh -fc then they all correctly exit on nonzero
status as expected.
Aside, should 'setopt err_return' in the nested function test be using
localoptions ?
[-- Attachment #2: errexit_xfail.txt --]
[-- Type: text/plain, Size: 1901 bytes --]
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index f120809a7..e3d9ea871 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -720,14 +720,15 @@ F:Must be tested with a top-level script rather than source or function
0:ERR_RETURN in "else" branch in nested function
>Good
+ unsetopt err_return # "leaked" from previous test
(setopt err_exit
for x in y; do
false && true
done
print OK
)
-0:ERR_EXIT not triggered by status 1 at end of for
->OK
+1f:ERR_EXIT triggered by status 1 at end of for
+F:This fails to exit for unknown reasons and prints OK
(setopt err_exit
integer x=0
@@ -736,8 +737,8 @@ F:Must be tested with a top-level script rather than source or function
done
print OK
)
-0:ERR_EXIT not triggered by status 1 at end of while
->OK
+1f:ERR_EXIT triggered by status 1 at end of while
+F:This fails to exit for unknown reasons and prints OK
(setopt err_exit
repeat 1; do
@@ -745,8 +746,8 @@ F:Must be tested with a top-level script rather than source or function
done
print OK
)
-0:ERR_EXIT not triggered by status 1 at end of repeat
->OK
+1f:ERR_EXIT triggered by status 1 at end of repeat
+F:This fails to exit for unknown reasons and prints OK
(setopt err_exit
if true; then
@@ -754,8 +755,8 @@ F:Must be tested with a top-level script rather than source or function
fi
print OK
)
-0:ERR_EXIT not triggered by status 1 at end of if
->OK
+1f:ERR_EXIT triggered by status 1 at end of if
+F:This fails to exit for unknown reasons and prints OK
(setopt err_exit
{
@@ -763,8 +764,8 @@ F:Must be tested with a top-level script rather than source or function
}
print OK
)
-0:ERR_EXIT not triggered by status 1 at end of { }
->OK
+1f:ERR_EXIT triggered by status 1 at end of { }
+F:This fails to exit for unknown reasons and prints OK
unsetopt err_exit err_return
(setopt err_exit
next reply other threads:[~2022-11-09 5:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 5:29 Bart Schaefer [this message]
2022-11-10 5:22 ` [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT) Bart Schaefer
2022-11-10 5:47 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7Z0zT8Lq5BKe4M-JzdjOYhQsmnHJZTVQ7V5+wLBd5u=zA@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).