mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 07:34:32 +00:00
Port most of the invocation tests to littlecheck
This is a bit weird sometimes, e.g. to test the return status (that fish actually *returns $status*), we use a #RUN line with %fish invoking %fish, so we can use the substitution. Still much nicer. The missing scripts are those that rely on config.
This commit is contained in:
parent
d415350aaf
commit
9d5620c170
21 changed files with 51 additions and 0 deletions
2
tests/checks/command-1.fish
Normal file
2
tests/checks/command-1.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish -c "echo 1.2.3.4."
|
||||
# CHECK: 1.2.3.4.
|
3
tests/checks/command-2.fish
Normal file
3
tests/checks/command-2.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
#RUN: %fish -c "echo 1.2.3.4." -c "echo 5.6.7.8."
|
||||
# CHECK: 1.2.3.4.
|
||||
# CHECK: 5.6.7.8.
|
2
tests/checks/command-vars-persist.fish
Normal file
2
tests/checks/command-vars-persist.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish -c 'set foo bar' -c 'echo $foo'
|
||||
# CHECK: bar
|
2
tests/checks/features-nocaret1.fish
Normal file
2
tests/checks/features-nocaret1.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish --features 'no-stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status'
|
||||
# CHECK: nocaret: 1
|
2
tests/checks/features-nocaret2.fish
Normal file
2
tests/checks/features-nocaret2.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish --features 'stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status'
|
||||
# CHECK: nocaret: 0
|
2
tests/checks/features-nocaret3.fish
Normal file
2
tests/checks/features-nocaret3.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish --features 'no-stderr-nocaret' -c 'echo -n careton:; echo ^/dev/null'
|
||||
# CHECK: careton:
|
2
tests/checks/features-nocaret4.fish
Normal file
2
tests/checks/features-nocaret4.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish --features ' stderr-nocaret' -c 'echo -n "caretoff: "; echo ^/dev/null'
|
||||
# CHECK: caretoff: ^/dev/null
|
2
tests/checks/features-qmark2.fish
Normal file
2
tests/checks/features-qmark2.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish --features 'qmark-noglob' -C 'string match --quiet "??" ab ; echo "qmarkoff: $status"'
|
||||
# CHECK: qmarkoff: 1
|
2
tests/checks/features-string-backslashes-off.fish
Normal file
2
tests/checks/features-string-backslashes-off.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish --features 'no-string-replace-fewer-backslashes' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
|
||||
# CHECK: a\b\c
|
2
tests/checks/features-string-backslashes.fish
Normal file
2
tests/checks/features-string-backslashes.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish --features 'string-replace-fewer-backslashes' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
|
||||
# CHECK: a\\b\\c
|
3
tests/checks/init-command-2.fish
Normal file
3
tests/checks/init-command-2.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
#RUN: %fish -C 'echo init-command' -C 'echo 2nd init-command'
|
||||
# CHECK: init-command
|
||||
# CHECK: 2nd init-command
|
3
tests/checks/init-command-mix-ordering.fish
Normal file
3
tests/checks/init-command-mix-ordering.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
#RUN: %fish -c 'echo command' -C 'echo init-command'
|
||||
# CHECK: init-command
|
||||
# CHECK: command
|
3
tests/checks/init-command-mix.fish
Normal file
3
tests/checks/init-command-mix.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
#RUN: %fish -C 'echo init-command' -c 'echo command'
|
||||
# CHECK: init-command
|
||||
# CHECK: command
|
2
tests/checks/init-command.fish
Normal file
2
tests/checks/init-command.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish -C 'echo init-command'
|
||||
# CHECK: init-command
|
3
tests/checks/interactive.fish
Normal file
3
tests/checks/interactive.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
#RUN: %fish -c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end; if status --is-interactive ; echo interactive ; else ; echo not interactive ; end' -i
|
||||
# CHECK: not login shell
|
||||
# CHECK: interactive
|
2
tests/checks/invocation.fish
Normal file
2
tests/checks/invocation.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish -c "echo 1.2.3.4."
|
||||
# CHECK: 1.2.3.4.
|
3
tests/checks/login-interactive.fish
Normal file
3
tests/checks/login-interactive.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
#RUN: %fish -c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end; if status --is-interactive ; echo interactive ; else ; echo not interactive ; end' -l -i
|
||||
# CHECK: login shell
|
||||
# CHECK: interactive
|
3
tests/checks/login.fish
Normal file
3
tests/checks/login.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
#RUN: %fish -c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end; if status --is-interactive ; echo interactive ; else ; echo not interactive ; end' -l
|
||||
# CHECK: login shell
|
||||
# CHECK: not interactive
|
4
tests/checks/no-login-no-interactive.fish
Normal file
4
tests/checks/no-login-no-interactive.fish
Normal file
|
@ -0,0 +1,4 @@
|
|||
#RUN: %fish -c 'if status --is-login ; echo login shell ; else ; echo not login shell ; end; if status --is-interactive ; echo interactive ; else ; echo not interactive ; end'
|
||||
|
||||
# CHECK: not login shell
|
||||
# CHECK: not interactive
|
2
tests/checks/rc-returned.fish
Normal file
2
tests/checks/rc-returned.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish -c '%fish -c false; echo RC: $status'
|
||||
# CHECK: RC: 1
|
2
tests/checks/version.fish
Normal file
2
tests/checks/version.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
#RUN: %fish -v
|
||||
# CHECK: fish, version {{[-.ga-f0-9]*(irty)?}}
|
Loading…
Reference in a new issue