mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Add tests for some other command line option invocations.
Some more of the invocations are tested in this change: - bad switches - errors in configuration files - regular command, configuration and init command ordering - persistence of variables over command invocation. - interactive and login switch use - terminal exit code return - version request There are sure to be other invocations that should be tested, but these give a fair number of them a go.
This commit is contained in:
parent
3f129b570c
commit
eb8b92fce7
31 changed files with 55 additions and 0 deletions
2
tests/invocation/bad-switch.err
Normal file
2
tests/invocation/bad-switch.err
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
./fish: invalid option -- 'Z'
|
||||||
|
RC: 1
|
1
tests/invocation/bad-switch.invoke
Normal file
1
tests/invocation/bad-switch.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-Z
|
2
tests/invocation/broken-config-continues.config
Normal file
2
tests/invocation/broken-config-continues.config
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
echo broken
|
||||||
|
syntax-error
|
7
tests/invocation/broken-config-continues.err
Normal file
7
tests/invocation/broken-config-continues.err
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fish: Unknown command 'syntax-error'
|
||||||
|
$XDG_CONFIG_HOME/fish/config.fish (line 2):
|
||||||
|
syntax-error
|
||||||
|
^
|
||||||
|
from sourcing file $XDG_CONFIG_HOME/fish/config.fish
|
||||||
|
called during startup
|
||||||
|
|
1
tests/invocation/broken-config-continues.invoke
Normal file
1
tests/invocation/broken-config-continues.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-c 'echo but still going'
|
2
tests/invocation/broken-config-continues.out
Normal file
2
tests/invocation/broken-config-continues.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
broken
|
||||||
|
but still going
|
1
tests/invocation/command-1.invoke
Normal file
1
tests/invocation/command-1.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-c "echo 1.2.3.4."
|
1
tests/invocation/command-1.out
Normal file
1
tests/invocation/command-1.out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1.2.3.4.
|
1
tests/invocation/command-2.invoke
Normal file
1
tests/invocation/command-2.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-c "echo 1.2.3.4." -c "echo 5.6.7.8."
|
2
tests/invocation/command-2.out
Normal file
2
tests/invocation/command-2.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
1.2.3.4.
|
||||||
|
5.6.7.8.
|
1
tests/invocation/command-vars-persist.invoke
Normal file
1
tests/invocation/command-vars-persist.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-c 'set foo bar' -c 'echo $foo'
|
1
tests/invocation/command-vars-persist.out
Normal file
1
tests/invocation/command-vars-persist.out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
bar
|
1
tests/invocation/config-command-ordering.config
Normal file
1
tests/invocation/config-command-ordering.config
Normal file
|
@ -0,0 +1 @@
|
||||||
|
echo in config.fish
|
1
tests/invocation/config-command-ordering.invoke
Normal file
1
tests/invocation/config-command-ordering.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-c "echo command" -C "echo init-command"
|
3
tests/invocation/config-command-ordering.out
Normal file
3
tests/invocation/config-command-ordering.out
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
in config.fish
|
||||||
|
init-command
|
||||||
|
command
|
1
tests/invocation/config.config
Normal file
1
tests/invocation/config.config
Normal file
|
@ -0,0 +1 @@
|
||||||
|
echo in config.fish
|
1
tests/invocation/config.invoke
Normal file
1
tests/invocation/config.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
tests/invocation/config.out
Normal file
1
tests/invocation/config.out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
in config.fish
|
3
tests/invocation/interactive.invoke
Normal file
3
tests/invocation/interactive.invoke
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
-c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end'
|
||||||
|
-c 'if status --is-interactive ; echo interactive ; else ; echo not interactive ; end'
|
||||||
|
-i
|
2
tests/invocation/interactive.out
Normal file
2
tests/invocation/interactive.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
not login shell
|
||||||
|
interactive
|
4
tests/invocation/login-interactive.invoke
Normal file
4
tests/invocation/login-interactive.invoke
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
-c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end'
|
||||||
|
-c 'if status --is-interactive ; echo interactive ; else ; echo not interactive ; end'
|
||||||
|
-l
|
||||||
|
-i
|
2
tests/invocation/login-interactive.out
Normal file
2
tests/invocation/login-interactive.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
login shell
|
||||||
|
interactive
|
3
tests/invocation/login.invoke
Normal file
3
tests/invocation/login.invoke
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
-c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end'
|
||||||
|
-c 'if status --is-interactive ; echo interactive ; else ; echo not interactive ; end'
|
||||||
|
-l
|
2
tests/invocation/login.out
Normal file
2
tests/invocation/login.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
login shell
|
||||||
|
not interactive
|
2
tests/invocation/no-login-no-interactive.invoke
Normal file
2
tests/invocation/no-login-no-interactive.invoke
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
-c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end'
|
||||||
|
-c 'if status --is-interactive ; echo interactive ; else ; echo not interactive ; end'
|
2
tests/invocation/no-login-no-interactive.out
Normal file
2
tests/invocation/no-login-no-interactive.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
not login shell
|
||||||
|
not interactive
|
1
tests/invocation/rc-returned.err
Normal file
1
tests/invocation/rc-returned.err
Normal file
|
@ -0,0 +1 @@
|
||||||
|
RC: 1
|
1
tests/invocation/rc-returned.invoke
Normal file
1
tests/invocation/rc-returned.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-c 'false'
|
1
tests/invocation/version.grep
Normal file
1
tests/invocation/version.grep
Normal file
|
@ -0,0 +1 @@
|
||||||
|
^fish, version
|
1
tests/invocation/version.invoke
Normal file
1
tests/invocation/version.invoke
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-v
|
1
tests/invocation/version.out
Normal file
1
tests/invocation/version.out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
fish, version
|
Loading…
Reference in a new issue