mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-22 10:48:03 +02: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
|
@ -793,6 +793,7 @@ exectry(Estate state, int do_exec)
|
||||||
cmdpop();
|
cmdpop();
|
||||||
popheap();
|
popheap();
|
||||||
state->pc = end;
|
state->pc = end;
|
||||||
|
this_noerrexit = 1;
|
||||||
|
|
||||||
return endval;
|
return endval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
0:ERR_RETURN in "else" branch in nested function
|
||||||
>Good
|
>Good
|
||||||
|
|
||||||
|
(setopt err_exit
|
||||||
|
false && true
|
||||||
|
print OK
|
||||||
|
)
|
||||||
|
0:ERR_EXIT not triggered by "false && true"
|
||||||
|
>OK
|
||||||
|
|
||||||
(setopt err_exit
|
(setopt err_exit
|
||||||
for x in y; do
|
for x in y; do
|
||||||
false && true
|
false && true
|
||||||
|
@ -727,16 +734,6 @@ F:Must be tested with a top-level script rather than source or function
|
||||||
print OK
|
print OK
|
||||||
)
|
)
|
||||||
0:ERR_EXIT not triggered by status 1 at end of for
|
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
|
>OK
|
||||||
|
|
||||||
(setopt err_exit
|
(setopt err_exit
|
||||||
|
@ -755,6 +752,31 @@ F:Must be tested with a top-level script rather than source or function
|
||||||
print OK
|
print OK
|
||||||
)
|
)
|
||||||
0:ERR_EXIT not triggered by status 1 at end of if
|
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
|
>OK
|
||||||
|
|
||||||
(setopt err_exit
|
(setopt err_exit
|
||||||
|
|
Loading…
Reference in a new issue