Add tests for evaluaton of empty blocks and functions

This commit is contained in:
Mahmoud Al-Qudsi 2019-04-12 07:58:55 -05:00
parent 87f6856954
commit ab37dfaf78
3 changed files with 26 additions and 0 deletions

3
tests/empty.err Normal file
View file

@ -0,0 +1,3 @@
####################
# Testing `0` after empty functions and blocks

16
tests/empty.in Normal file
View 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
View file

@ -0,0 +1,7 @@
####################
# Testing `0` after empty functions and blocks
0
0
1
0