mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 04:52:44 +08:00
tests: Move directory redirection test to invocation
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.
This commit is contained in:
parent
ca5b7c0ec4
commit
c62d95e428
3
tests/invocation/directory-redirect.err
Normal file
3
tests/invocation/directory-redirect.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
<W> fish: An error occurred while redirecting file '.'
|
||||
open: Is a directory
|
||||
RC: 1
|
3
tests/invocation/directory-redirect.err.SunOS
Normal file
3
tests/invocation/directory-redirect.err.SunOS
Normal file
|
@ -0,0 +1,3 @@
|
|||
<W> fish: An error occurred while redirecting file '.'
|
||||
open: Invalid argument
|
||||
RC: 1
|
1
tests/invocation/directory-redirect.invoke
Normal file
1
tests/invocation/directory-redirect.invoke
Normal file
|
@ -0,0 +1 @@
|
|||
-c 'begin; end > . ; status -b; and echo "status -b returned true after bad redirect on a begin block"'
|
|
@ -1,5 +1,3 @@
|
|||
<W> fish: An error occurred while redirecting file '.'
|
||||
open: Is a directory
|
||||
status: Invalid combination of options,
|
||||
you cannot do both 'is-interactive' and 'is-login' in the same invocation
|
||||
status: Invalid combination of options,
|
||||
|
|
|
@ -8,12 +8,6 @@ begin
|
|||
or echo '"status -b" unexpectedly returned false inside a begin block'
|
||||
end
|
||||
|
||||
# Issue #1728
|
||||
# Bad file redirection on a block causes `status --is-block` to return 0 forever.
|
||||
begin; end >. # . is a directory, it can't be opened for writing
|
||||
status -b
|
||||
and echo '"status -b" unexpectedly returned true after bad redirect on a begin block'
|
||||
|
||||
status -l
|
||||
and echo '"status -l" unexpectedly returned true for a non-login shell'
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user