diff --git a/tests/status.err b/tests/status.err index 87e63a330..ad52d81c6 100644 --- a/tests/status.err +++ b/tests/status.err @@ -7,3 +7,6 @@ status: Invalid job control mode '1none' #################### # Future Feature Flags + +#################### +# Ensure $status isn't reset before a function is executed diff --git a/tests/status.in b/tests/status.in index 9f33badd6..ad68a9231 100644 --- a/tests/status.in +++ b/tests/status.in @@ -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 diff --git a/tests/status.out b/tests/status.out index 283b13030..b5cb078c0 100644 --- a/tests/status.out +++ b/tests/status.out @@ -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