mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-28 05:00:59 +01:00
51001: fix for ERR_EXIT with "always" blocks; update tests
This commit is contained in:
parent
23dc19f005
commit
fda6fd9513
2 changed files with 33 additions and 10 deletions
|
|
@ -720,6 +720,13 @@ F:Must be tested with a top-level script rather than source or function
|
|||
0:ERR_RETURN in "else" branch in nested function
|
||||
>Good
|
||||
|
||||
(setopt err_exit
|
||||
false && true
|
||||
print OK
|
||||
)
|
||||
0:ERR_EXIT not triggered by "false && true"
|
||||
>OK
|
||||
|
||||
(setopt err_exit
|
||||
for x in y; do
|
||||
false && true
|
||||
|
|
@ -727,16 +734,6 @@ 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 for
|
||||
>OK
|
||||
|
||||
(setopt err_exit
|
||||
integer x=0
|
||||
while (( ! x++ )); do
|
||||
false && true
|
||||
done
|
||||
print OK
|
||||
)
|
||||
0:ERR_EXIT not triggered by status 1 at end of while
|
||||
>OK
|
||||
|
||||
(setopt err_exit
|
||||
|
|
@ -755,6 +752,31 @@ 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 if
|
||||
>OK
|
||||
|
||||
(setopt err_exit
|
||||
loop=true
|
||||
while print COND; $loop; do
|
||||
loop=false
|
||||
false && true
|
||||
done
|
||||
print OK
|
||||
)
|
||||
0:ERR_EXIT not triggered by status 1 at end of while
|
||||
>COND
|
||||
>COND
|
||||
>OK
|
||||
|
||||
(setopt err_exit
|
||||
{
|
||||
false && true
|
||||
} always {
|
||||
print ALWAYS
|
||||
}
|
||||
print OK
|
||||
)
|
||||
0:ERR_EXIT not triggered by status 1 at end of always
|
||||
>ALWAYS
|
||||
>OK
|
||||
|
||||
(setopt err_exit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue