Port empty functions test to littlecheck

This commit is contained in:
ridiculousfish 2019-12-07 11:02:22 -08:00
parent a7f6fd22d4
commit 098fe86ebf
4 changed files with 18 additions and 26 deletions

18
tests/checks/empty.fish Normal file
View File

@ -0,0 +1,18 @@
# RUN: %fish %s
# See issue 5692
function empty
end
# functions should not preserve $status
false; empty; echo $status
# CHECK: 0
true; empty; echo $status
# CHECK: 0
# blocks should preserve $status
false; begin; end; echo $status
# CHECK: 1
true; begin; end; echo $status
# CHECK: 0

View File

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

View File

@ -1,16 +0,0 @@
# 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

View File

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