Test: validate $status is preserved on calling into a function

This commit is contained in:
Mahmoud Al-Qudsi 2019-04-13 12:11:42 -05:00
parent ab37dfaf78
commit 47a61a3202
3 changed files with 15 additions and 0 deletions

View file

@ -7,3 +7,6 @@ status: Invalid job control mode '1none'
####################
# Future Feature Flags
####################
# Ensure $status isn't reset before a function is executed

View file

@ -48,3 +48,10 @@ logmsg Future Feature Flags
status features
status test-feature stderr-nocaret ; echo $status
status test-feature not-a-feature ; echo $status
logmsg 'Ensure $status isn\'t reset before a function is executed'
function echo_last
echo $status
end
false; echo_last; echo $status #1

View file

@ -9,3 +9,8 @@ qmark-noglob off 3.0 ? no longer globs
string-replace-fewer-backslashes off 3.1 string replace -r needs fewer backslashes in the replacement
1
2
####################
# Ensure $status isn't reset before a function is executed
1
0