mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
c62d95e428
This tested #1728, where redirecting a directory (`begin; something; end < .`) would cause `status` to misbehave. Unfortunately, on Illumos/OpenIndiana/SunOS, this returns a different error (EINVAL instead of EISDIR), so we can't check that with our test harness, because we can't redirect it. Since it's not important that this gives the same error across systems (and indeed we provide no way of intercepting the error!), use an invocation test instead, because that allows different output per-uname. See #5472.
50 lines
1.2 KiB
Fish
50 lines
1.2 KiB
Fish
# vim: set filetype=fish:
|
|
|
|
status -b
|
|
and echo '"status -b" unexpectedly returned true at top level'
|
|
|
|
begin
|
|
status -b
|
|
or echo '"status -b" unexpectedly returned false inside a begin block'
|
|
end
|
|
|
|
status -l
|
|
and echo '"status -l" unexpectedly returned true for a non-login shell'
|
|
|
|
status -i
|
|
and echo '"status -i" unexpectedly returned true for a non-interactive shell'
|
|
|
|
status is-login
|
|
and echo '"status is-login" unexpectedly returned true for a non-login shell'
|
|
|
|
status is-interactive
|
|
and echo '"status is-interactive" unexpectedly returned true for a non-interactive shell'
|
|
|
|
# We should get an error message about an invalid combination of flags.
|
|
status --is-interactive --is-login
|
|
|
|
# We should get an error message about an unexpected arg for `status
|
|
# is-block`.
|
|
status -b is-interactive
|
|
|
|
# Try to set the job control to an invalid mode.
|
|
status job-control full1
|
|
status --job-control=1none
|
|
|
|
# Now set it to a valid mode.
|
|
status job-control none
|
|
|
|
# Check status -u outside functions
|
|
status current-function
|
|
|
|
function test_function
|
|
status current-function
|
|
end
|
|
|
|
test_function
|
|
eval test_function
|
|
|
|
logmsg Future Feature Flags
|
|
status features
|
|
status test-feature stderr-nocaret ; echo $status
|
|
status test-feature not-a-feature ; echo $status
|