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:
Charles Ferguson 2017-06-29 16:37:55 +01:00 committed by Kurtis Rader
parent 3f129b570c
commit eb8b92fce7
31 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,2 @@
./fish: invalid option -- 'Z'
RC: 1

View file

@ -0,0 +1 @@
-Z

View file

@ -0,0 +1,2 @@
echo broken
syntax-error

View 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

View file

@ -0,0 +1 @@
-c 'echo but still going'

View file

@ -0,0 +1,2 @@
broken
but still going

View file

@ -0,0 +1 @@
-c "echo 1.2.3.4."

View file

@ -0,0 +1 @@
1.2.3.4.

View file

@ -0,0 +1 @@
-c "echo 1.2.3.4." -c "echo 5.6.7.8."

View file

@ -0,0 +1,2 @@
1.2.3.4.
5.6.7.8.

View file

@ -0,0 +1 @@
-c 'set foo bar' -c 'echo $foo'

View file

@ -0,0 +1 @@
bar

View file

@ -0,0 +1 @@
echo in config.fish

View file

@ -0,0 +1 @@
-c "echo command" -C "echo init-command"

View file

@ -0,0 +1,3 @@
in config.fish
init-command
command

View file

@ -0,0 +1 @@
echo in config.fish

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@
in config.fish

View 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

View file

@ -0,0 +1,2 @@
not login shell
interactive

View 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

View file

@ -0,0 +1,2 @@
login shell
interactive

View 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

View file

@ -0,0 +1,2 @@
login shell
not interactive

View 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'

View file

@ -0,0 +1,2 @@
not login shell
not interactive

View file

@ -0,0 +1 @@
RC: 1

View file

@ -0,0 +1 @@
-c 'false'

View file

@ -0,0 +1 @@
^fish, version

View file

@ -0,0 +1 @@
-v

View file

@ -0,0 +1 @@
fish, version