mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
Add tests for evaluaton of empty blocks and functions
This commit is contained in:
parent
87f6856954
commit
ab37dfaf78
3 changed files with 26 additions and 0 deletions
3
tests/empty.err
Normal file
3
tests/empty.err
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Testing `0` after empty functions and blocks
|
16
tests/empty.in
Normal file
16
tests/empty.in
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# See issue 5692
|
||||||
|
|
||||||
|
logmsg "Testing `$status` after empty functions and blocks"
|
||||||
|
|
||||||
|
function empty
|
||||||
|
end
|
||||||
|
|
||||||
|
# functions shouldn't preserve $status
|
||||||
|
|
||||||
|
false; empty; echo $status # 0
|
||||||
|
true; empty; echo $status # 0
|
||||||
|
|
||||||
|
# blocks should preserve $status
|
||||||
|
|
||||||
|
false; begin; end; echo $status # 1
|
||||||
|
true; begin; end; echo $status # 0
|
7
tests/empty.out
Normal file
7
tests/empty.out
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Testing `0` after empty functions and blocks
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
Loading…
Reference in a new issue