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:
Fabian Homborg 2019-06-25 20:47:28 +02:00
parent d415350aaf
commit 9d5620c170
21 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,2 @@
#RUN: %fish -c "echo 1.2.3.4."
# CHECK: 1.2.3.4.

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

View file

@ -0,0 +1,2 @@
#RUN: %fish -c 'set foo bar' -c 'echo $foo'
# CHECK: bar

View file

@ -0,0 +1,2 @@
#RUN: %fish --features 'no-stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status'
# CHECK: nocaret: 1

View file

@ -0,0 +1,2 @@
#RUN: %fish --features 'stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status'
# CHECK: nocaret: 0

View file

@ -0,0 +1,2 @@
#RUN: %fish --features 'no-stderr-nocaret' -c 'echo -n careton:; echo ^/dev/null'
# CHECK: careton:

View file

@ -0,0 +1,2 @@
#RUN: %fish --features ' stderr-nocaret' -c 'echo -n "caretoff: "; echo ^/dev/null'
# CHECK: caretoff: ^/dev/null

View file

@ -0,0 +1,2 @@
#RUN: %fish --features 'qmark-noglob' -C 'string match --quiet "??" ab ; echo "qmarkoff: $status"'
# CHECK: qmarkoff: 1

View file

@ -0,0 +1,2 @@
#RUN: %fish --features 'no-string-replace-fewer-backslashes' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
# CHECK: a\b\c

View file

@ -0,0 +1,2 @@
#RUN: %fish --features 'string-replace-fewer-backslashes' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
# CHECK: a\\b\\c

View file

@ -0,0 +1,3 @@
#RUN: %fish -C 'echo init-command' -C 'echo 2nd init-command'
# CHECK: init-command
# CHECK: 2nd init-command

View file

@ -0,0 +1,3 @@
#RUN: %fish -c 'echo command' -C 'echo init-command'
# CHECK: init-command
# CHECK: command

View file

@ -0,0 +1,3 @@
#RUN: %fish -C 'echo init-command' -c 'echo command'
# CHECK: init-command
# CHECK: command

View file

@ -0,0 +1,2 @@
#RUN: %fish -C 'echo init-command'
# CHECK: init-command

View 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

View file

@ -0,0 +1,2 @@
#RUN: %fish -c "echo 1.2.3.4."
# CHECK: 1.2.3.4.

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

View 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

View file

@ -0,0 +1,2 @@
#RUN: %fish -c '%fish -c false; echo RC: $status'
# CHECK: RC: 1

View file

@ -0,0 +1,2 @@
#RUN: %fish -v
# CHECK: fish, version {{[-.ga-f0-9]*(irty)?}}