mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-28 17:10:59 +01:00
27126: a few more contexts where executing empty lists gives status zero
This commit is contained in:
parent
b4c2ea2cec
commit
4db28c55b6
6 changed files with 51 additions and 2 deletions
|
|
@ -27,6 +27,18 @@
|
|||
$nonexistent_variable
|
||||
0:Executing command that evaluates to empty resets status
|
||||
|
||||
false
|
||||
sleep 1 &
|
||||
print $?
|
||||
# a tidy test is a happy test
|
||||
wait $!
|
||||
0:Starting background command resets status
|
||||
>0
|
||||
|
||||
false
|
||||
. /dev/null
|
||||
0:Sourcing empty file resets status
|
||||
|
||||
fn() { local foo; read foo; print $foo; }
|
||||
coproc fn
|
||||
print -p coproc test output
|
||||
|
|
@ -531,3 +543,13 @@
|
|||
. ./bad_syntax
|
||||
126: Attempt to "." file with bad syntax.
|
||||
?./bad_syntax:2: parse error near `\n'
|
||||
|
||||
echo 'false' >dot_false
|
||||
. ./dot_false
|
||||
print $?
|
||||
echo 'true' >dot_true
|
||||
. ./dot_true
|
||||
print $?
|
||||
0:Last status of successfully executed "." file is retained
|
||||
>1
|
||||
>0
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
%test
|
||||
|
||||
fn1() { return 1; }
|
||||
fn2() {
|
||||
fn1
|
||||
print $?
|
||||
return 2
|
||||
}
|
||||
fn2
|
||||
2:Basic status returns from functions
|
||||
>1
|
||||
|
||||
fnz() { }
|
||||
false
|
||||
fnz
|
||||
0:Empty function body resets status
|
||||
|
||||
function f$$ () {
|
||||
print regress expansion of function names
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,3 +89,7 @@
|
|||
X=$(exit 2) $(exit 0) || print $?
|
||||
0:variable assignments processed after other substitutions
|
||||
>2
|
||||
|
||||
false
|
||||
``
|
||||
0:Empty command substitution resets status
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue