tests: filter control sequences only when interactive

This demonstrates that we only write control sequences when interactive.
This commit is contained in:
Johannes Altmanninger 2024-04-12 12:19:32 +02:00
parent 9158395d10
commit 1e858eae35
139 changed files with 167 additions and 163 deletions

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Universal abbreviations are imported. # Universal abbreviations are imported.
set -U _fish_abbr_cuckoo somevalue set -U _fish_abbr_cuckoo somevalue

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Avoid regressions of issue \#3860 wherein the first word of the alias ends with a semicolon # Avoid regressions of issue \#3860 wherein the first word of the alias ends with a semicolon
function foo function foo
echo ran foo echo ran foo

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# "Basic && and || support" # "Basic && and || support"
echo first && echo second echo first && echo second

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
set -xl LANG C # uniform quotes set -xl LANG C # uniform quotes

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
########## ##########
# NOTE: This uses argparse, which touches the local variables. # NOTE: This uses argparse, which touches the local variables.

View file

@ -1,2 +1,2 @@
#RUN: %fish -Z | %filter-ctrlseqs #RUN: %fish -Z
# CHECKERR: {{.*fish}}: {{unrecognized option: Z|invalid option -- '?Z'?|unknown option -- Z|illegal option -- Z|-Z: unknown option}} # CHECKERR: {{.*fish}}: {{unrecognized option: Z|invalid option -- '?Z'?|unknown option -- Z|illegal option -- Z|-Z: unknown option}}

View file

@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs # RUN: %fish -C 'set -g fish %fish' %s
# #
# Test function, loops, conditionals and some basic elements # Test function, loops, conditionals and some basic elements
# #

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
#REQUIRES: command -v diff #REQUIRES: command -v diff
set -l fish (status fish-path) set -l fish (status fish-path)

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
echo x-{1} echo x-{1}
#CHECK: x-{1} #CHECK: x-{1}

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -g fish %fish' %s
begin begin
set -l dir $PWD/(dirname (status -f)) set -l dir $PWD/(dirname (status -f))
set -gx XDG_CONFIG_HOME $dir/broken-config/ set -gx XDG_CONFIG_HOME $dir/broken-config/

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Tests for the "builtin" builtin/keyword. # Tests for the "builtin" builtin/keyword.
builtin -q string; and echo String exists builtin -q string; and echo String exists
#CHECK: String exists #CHECK: String exists

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
echo (function foo1 --on-job-exit caller; end; functions --handlers-type caller-exit | grep foo) echo (function foo1 --on-job-exit caller; end; functions --handlers-type caller-exit | grep foo)
# CHECK: caller-exit foo1 # CHECK: caller-exit foo1
echo (function foo2 --on-job-exit caller; end; functions --handlers-type process-exit | grep foo) echo (function foo2 --on-job-exit caller; end; functions --handlers-type process-exit | grep foo)

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Verify the '--on-job-exit caller' misfeature. # Verify the '--on-job-exit caller' misfeature.
function make_call_observer -a type function make_call_observer -a type

View file

@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs # RUN: %fish -C 'set -g fish %fish' %s
set -g fish (realpath $fish) set -g fish (realpath $fish)

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s
# Test ALL THE FISH FILES # Test ALL THE FISH FILES
# in share/, that is - the tests are exempt because they contain syntax errors, on purpose # in share/, that is - the tests are exempt because they contain syntax errors, on purpose

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s
# Test all completions where the command exists # Test all completions where the command exists
# No output is good output # No output is good output

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s
#REQUIRES: msgfmt --help #REQUIRES: msgfmt --help
set -l fail_count 0 set -l fail_count 0

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# This tests various corner cases involving command substitution. # This tests various corner cases involving command substitution.

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
echo $(echo 1\n2) echo $(echo 1\n2)
# CHECK: 1 2 # CHECK: 1 2

View file

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

View file

@ -1,3 +1,3 @@
#RUN: %fish -c "echo 1.2.3.4." -c "echo 5.6.7.8." | %filter-ctrlseqs #RUN: %fish -c "echo 1.2.3.4." -c "echo 5.6.7.8."
# CHECK: 1.2.3.4. # CHECK: 1.2.3.4.
# CHECK: 5.6.7.8. # CHECK: 5.6.7.8.

View file

@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs # RUN: %fish -C 'set -g fish %fish' %s | %filter-control-sequences
set -g PATH set -g PATH
$fish -c "nonexistent-command-1234 banana rama" $fish -c "nonexistent-command-1234 banana rama"
#CHECKERR: fish: Unknown command: nonexistent-command-1234 #CHECKERR: fish: Unknown command: nonexistent-command-1234

View file

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

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
commandline --input "echo foo | bar" --is-valid commandline --input "echo foo | bar" --is-valid
and echo Valid and echo Valid

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s
function fooc; true; end; function fooc; true; end;

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s
function complete_test_alpha1 function complete_test_alpha1
echo $argv echo $argv
end end

View file

@ -1,4 +1,4 @@
#RUN: %fish --interactive %s | %filter-ctrlseqs #RUN: %fish --interactive %s | %filter-control-sequences
# ^ interactive so we can do `complete` # ^ interactive so we can do `complete`
mkdir -p __fish_complete_directories/ mkdir -p __fish_complete_directories/
cd __fish_complete_directories cd __fish_complete_directories

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
function commandline function commandline
if test $argv[1] = -ct if test $argv[1] = -ct
echo --long4\n-4 echo --long4\n-4

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Validate the behavior of the `count` command. # Validate the behavior of the `count` command.
# no args # no args

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# Ensure we don't hang on deep command substitutions - see #6503. # Ensure we don't hang on deep command substitutions - see #6503.

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -g fish %fish' %s
if command -q getconf if command -q getconf
# (no env -u, some systems don't support that) # (no env -u, some systems don't support that)

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
begin begin
end >. end >.
status -b; and echo "status -b returned true after bad redirect on a begin block" status -b; and echo "status -b returned true after bad redirect on a begin block"

View file

@ -1,4 +1,4 @@
# RUN: env fish_test_helper=%fish_test_helper %fish %s | %filter-ctrlseqs # RUN: env fish_test_helper=%fish_test_helper %fish %s
# Ensure that a job which attempts to disown itself does not explode. # Ensure that a job which attempts to disown itself does not explode.
# Here fish_test_helper is the process group leader; we attempt to disown # Here fish_test_helper is the process group leader; we attempt to disown

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# See issue 5692 # See issue 5692

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
function getenvs function getenvs
env | string match FISH_ENV_TEST_\* env | string match FISH_ENV_TEST_\*

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# Regression test for issue #4443 # Regression test for issue #4443
eval set -l previously_undefined foo eval set -l previously_undefined foo
echo $previously_undefined echo $previously_undefined

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s
exec cat <nosuchfile exec cat <nosuchfile
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile' #CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
argparse r-require= -- --require 2>/dev/null argparse r-require= -- --require 2>/dev/null
echo $status echo $status
# CHECK: 2 # CHECK: 2

View file

@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs # RUN: %fish -C 'set -g fish %fish' %s
# caret position (#5812) # caret position (#5812)
printf '<%s>\n' ($fish -c ' $f[a]' 2>&1) printf '<%s>\n' ($fish -c ' $f[a]' 2>&1)

View file

@ -1,4 +1,4 @@
# RUN: %fish -C "set helper %fish_test_helper" %s | %filter-ctrlseqs # RUN: %fish -C "set helper %fish_test_helper" %s
# Check that we don't leave stray FDs. # Check that we don't leave stray FDs.

View file

@ -1,4 +1,4 @@
#RUN: %fish --features=ampersand-nobg-in-token -C 'set -g fish_indent %fish_indent' %s | %filter-ctrlseqs #RUN: %fish --features=ampersand-nobg-in-token -C 'set -g fish_indent %fish_indent' %s
echo no&background echo no&background
# CHECK: no&background # CHECK: no&background

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
#RUN: %fish --features=remove-percent-self %s | %filter-ctrlseqs #RUN: %fish --features=remove-percent-self %s
echo %self echo %self
# CHECK: %self # CHECK: %self

View file

@ -1,2 +1,2 @@
#RUN: %fish --features 'remove-percent-self' -c 'status test-feature remove-percent-self; echo remove-percent-self: $status' | %filter-ctrlseqs #RUN: %fish --features 'remove-percent-self' -c 'status test-feature remove-percent-self; echo remove-percent-self: $status'
# CHECK: remove-percent-self: 0 # CHECK: remove-percent-self: 0

View file

@ -1,3 +1,3 @@
# Explicitly overriding HOME/XDG_CONFIG_HOME is only required if not invoking via `make test` # Explicitly overriding HOME/XDG_CONFIG_HOME is only required if not invoking via `make test`
# RUN: %fish --features '' -c 'string match --quiet "??" ab ; echo "qmarkon: $status"' | %filter-ctrlseqs # RUN: %fish --features '' -c 'string match --quiet "??" ab ; echo "qmarkon: $status"'
#CHECK: qmarkon: 1 #CHECK: qmarkon: 1

View file

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

View file

@ -1,2 +1,2 @@
#RUN: %fish --features 'no-regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' | %filter-ctrlseqs #RUN: %fish --features 'no-regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
# CHECK: a\b\c # CHECK: a\b\c

View file

@ -1,2 +1,2 @@
#RUN: %fish --features 'regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' | %filter-ctrlseqs #RUN: %fish --features 'regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
# CHECK: a\\b\\c # CHECK: a\\b\\c

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# #
# This deals with $PATH manipulation. We need to be careful not to step on anything. # This deals with $PATH manipulation. We need to be careful not to step on anything.

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -g fish %fish' %s
# fish_exit fires successfully. # fish_exit fires successfully.
echo 'function do_exit --on-event fish_exit; echo "fish_exiting $fish_pid"; end' > /tmp/test_exit.fish echo 'function do_exit --on-event fish_exit; echo "fish_exiting $fish_pid"; end' > /tmp/test_exit.fish

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# #
# This deals with $PATH manipulation. We need to be careful not to step on anything. # This deals with $PATH manipulation. We need to be careful not to step on anything.

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# A for-loop-variable is a local variable in the enclosing scope. # A for-loop-variable is a local variable in the enclosing scope.
set -g i global set -g i global

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
function stuff --argument a b c function stuff --argument a b c
# This is a comment # This is a comment

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
function t --argument-names a b c function t --argument-names a b c
echo t echo t
end end

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Test the `functions` builtin # Test the `functions` builtin
function f1 function f1

View file

@ -1,4 +1,4 @@
#RUN: %fish -i %s | %filter-ctrlseqs #RUN: %fish -i %s | %filter-control-sequences
# Note: ^ this is interactive so we test interactive behavior, # Note: ^ this is interactive so we test interactive behavior,
# e.g. the fish_git_prompt variable handlers test `status is-interactive`. # e.g. the fish_git_prompt variable handlers test `status is-interactive`.
#REQUIRES: command -v git #REQUIRES: command -v git

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
set -l oldpwd $PWD set -l oldpwd $PWD
cd (mktemp -d) cd (mktemp -d)

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Verify that specifying unexpected options or arguments results in an error. # Verify that specifying unexpected options or arguments results in an error.
# First using the legacy, now deprecated, long options to specify a # First using the legacy, now deprecated, long options to specify a

View file

@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish_indent %fish_indent' %s | %filter-ctrlseqs # RUN: %fish -C 'set -g fish_indent %fish_indent' %s
# Test file for fish_indent # Test file for fish_indent
# Note that littlecheck ignores leading whitespace, so we have to use {{ }} to explicitly match it. # Note that littlecheck ignores leading whitespace, so we have to use {{ }} to explicitly match it.

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -g fish %fish' %s
# Test that fish doesn't crash if cwd is unreadable at the start (#6597) # Test that fish doesn't crash if cwd is unreadable at the start (#6597)
set -l oldpwd $PWD set -l oldpwd $PWD

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s | %filter-control-sequences
$fish -c "echo 1.2.3.4." $fish -c "echo 1.2.3.4."
# CHECK: 1.2.3.4. # CHECK: 1.2.3.4.

View file

@ -1,4 +1,4 @@
#RUN: env fth=%fish_test_helper fish=%fish %fish %s | %filter-ctrlseqs #RUN: env fth=%fish_test_helper fish=%fish %fish %s
# Ensure job control works in non-interactive environments. # Ensure job control works in non-interactive environments.

View file

@ -1,4 +1,4 @@
#RUN: echo 'status job-control full; command echo A ; echo B;' | %fish | %filter-ctrlseqs #RUN: echo 'status job-control full; command echo A ; echo B;' | %fish
# Regression test for #6573. # Regression test for #6573.

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# Ensure that job IDs are sequential. # Ensure that job IDs are sequential.

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# Ensure that jobs are printed with new lines escaped # Ensure that jobs are printed with new lines escaped

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Verify zombies are not left by disown (#7183, #5342) # Verify zombies are not left by disown (#7183, #5342)
# Do this first to avoid colliding with the other disowned processes below, which may # Do this first to avoid colliding with the other disowned processes below, which may

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
ech\ ech\
o echo o echo
#CHECK: echo #CHECK: echo

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# #
# These lines left around because we need the line numbers. # These lines left around because we need the line numbers.
# This file in general requires careful editing in the middle, I recommend appending. # This file in general requires careful editing in the middle, I recommend appending.

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# musl currently does not have a `locale` command, so we skip this test there. # musl currently does not have a `locale` command, so we skip this test there.
# REQUIRES: command -v locale # REQUIRES: command -v locale
# We need a comma-using locale we know. # We need a comma-using locale we know.

View file

@ -1,4 +1,4 @@
#RUN: %fish -C "set fish %fish" %s | %filter-ctrlseqs #RUN: %fish -C "set fish %fish" %s
# This hangs when running on github actions with tsan for unknown reasons, # This hangs when running on github actions with tsan for unknown reasons,
# see #7934. # see #7934.
#REQUIRES: test -z "$GITHUB_WORKFLOW" #REQUIRES: test -z "$GITHUB_WORKFLOW"

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -g fish %fish' %s
function never_runs function never_runs
while false while false

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# OpenBSD doesn't do hex numbers in str/wcstod (like C99 requires). # OpenBSD doesn't do hex numbers in str/wcstod (like C99 requires).
# So let's skip this. # So let's skip this.
#REQUIRES: test "$(uname)" != OpenBSD #REQUIRES: test "$(uname)" != OpenBSD

View file

@ -1,4 +1,4 @@
#RUN: %fish --no-config %s | %filter-ctrlseqs #RUN: %fish --no-config %s
functions | string match help functions | string match help
# CHECK: help # CHECK: help

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish' %s
# Test that fish -n doesn't check for command existence - function autoloading throws a wrench in that. # Test that fish -n doesn't check for command existence - function autoloading throws a wrench in that.
echo "type foo" | $fish -n echo "type foo" | $fish -n

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# Do not run under sanitizers in CI, as they intercept a busted posix_spawn # Do not run under sanitizers in CI, as they intercept a busted posix_spawn
# which mishandles shebangless scripts. # which mishandles shebangless scripts.

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
not true not true
echo $status echo $status

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# NUL-handling # NUL-handling
# This one actually prints a NUL # This one actually prints a NUL

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# The "path" builtin for dealing with paths # The "path" builtin for dealing with paths
# Extension - for figuring out the file extension of a given path. # Extension - for figuring out the file extension of a given path.

View file

@ -1,4 +1,4 @@
# RUN: env fth=%fish_test_helper fish=%fish %fish %s | %filter-ctrlseqs # RUN: env fth=%fish_test_helper fish=%fish %fish %s
status job-control full status job-control full

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# pipestatus variable - builtins only # pipestatus variable - builtins only
false | false | false false | false | false

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# Test redirecting builtin help with a pipe # Test redirecting builtin help with a pipe
set -lx __fish_data_dir (mktemp -d) set -lx __fish_data_dir (mktemp -d)

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
printf "%d %d\n" 1 2 3 printf "%d %d\n" 1 2 3
# CHECK: 1 2 # CHECK: 1 2

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
prompt_pwd -d 1 /foo/bar/baz prompt_pwd -d 1 /foo/bar/baz
# CHECK: /f/b/baz # CHECK: /f/b/baz

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
set -l filename (echo foo | psub --testing) set -l filename (echo foo | psub --testing)
test -f $filename test -f $filename
or echo 'psub is not a regular file' >&2 or echo 'psub is not a regular file' >&2

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
set -l max 9223372036854775807 set -l max 9223372036854775807
set -l close_max 9223372036854775806 set -l close_max 9223372036854775806
set -l min -9223372036854775807 set -l min -9223372036854775807

View file

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

View file

@ -1,4 +1,4 @@
# RUN: %fish -C "set fish %fish" %s | %filter-ctrlseqs # RUN: %fish -C "set -g fish %fish; set -g filter_ctrls %filter-control-sequences" %s
# Set term again explicitly to ensure behavior. # Set term again explicitly to ensure behavior.
set -gx TERM xterm set -gx TERM xterm
# Read with no vars is not an error # Read with no vars is not an error
@ -248,7 +248,7 @@ if test (string length "$x") -ne $fish_read_limit
end end
# Confirm reading non-interactively works -- \#4206 regression # Confirm reading non-interactively works -- \#4206 regression
echo abc\ndef | $fish -i -c 'read a; read b; set --show a; set --show b' echo abc\ndef | $fish -i -c 'read a; read b; set --show a; set --show b' | $filter_ctrls
#CHECK: $a: set in global scope, unexported, with 1 elements #CHECK: $a: set in global scope, unexported, with 1 elements
#CHECK: $a[1]: |abc| #CHECK: $a[1]: |abc|
#CHECK: $b: set in global scope, unexported, with 1 elements #CHECK: $b: set in global scope, unexported, with 1 elements

View file

@ -1,4 +1,4 @@
# RUN: %fish %s | %filter-ctrlseqs # RUN: %fish %s
# $XDG_DATA_HOME can itself be a relative path. So force it to an absolute # $XDG_DATA_HOME can itself be a relative path. So force it to an absolute
# path so we can remove it from any resolved paths below. This is needed # path so we can remove it from any resolved paths below. This is needed
# because the contents of the builtin realpath.out file can't include any $PWD # because the contents of the builtin realpath.out file can't include any $PWD

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
function outnerr function outnerr
command echo out $argv command echo out $argv

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Tests for importing named regex groups as fish variables # Tests for importing named regex groups as fish variables
# Invalid variable name? # Invalid variable name?

View file

@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs #RUN: %fish -C 'set -l fish %fish; set -l filter_ctrls %filter-control-sequences' %s
# Some tests of the "return" builtin. # Some tests of the "return" builtin.
$fish -c 'return 5' $fish -c 'return 5'
@ -15,11 +15,13 @@ $fish -c 'echo foo; return 2; echo bar'
echo $status echo $status
# CHECK: 2 # CHECK: 2
$fish -ic 'echo interactive-foo; return 69; echo interactive-bar' begin
# CHECK: interactive-foo $fish -ic 'echo interactive-foo; return 69; echo interactive-bar'
# but not bar # CHECK: interactive-foo
echo $status # but not bar
# CHECK: 69 echo $status
# CHECK: 69
end | $filter_ctrls
# Verify negative return values don't cause UB and never map to 0 # Verify negative return values don't cause UB and never map to 0
function empty_return function empty_return

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# Test scoping rules for functions and status # Test scoping rules for functions and status
set -e smurf set -e smurf

View file

@ -1,4 +1,4 @@
#RUN: %fish %s | %filter-ctrlseqs #RUN: %fish %s
# See #6397 # See #6397

Some files were not shown because too many files have changed in this diff Show more