mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-25 14:51:15 -03:00
Port empty functions test to littlecheck
This commit is contained in:
18
tests/checks/empty.fish
Normal file
18
tests/checks/empty.fish
Normal 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
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
####################
|
||||
# Testing `0` after empty functions and blocks
|
||||
@@ -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
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
####################
|
||||
# Testing `0` after empty functions and blocks
|
||||
0
|
||||
0
|
||||
1
|
||||
0
|
||||
Reference in New Issue
Block a user