From 1e858eae3515af8b9a31d12352faa680b6d1df71 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 12 Apr 2024 12:19:32 +0200 Subject: [PATCH] tests: filter control sequences only when interactive This demonstrates that we only write control sequences when interactive. --- tests/checks/abbr.fish | 2 +- tests/checks/alias.fish | 2 +- tests/checks/andandoror.fish | 2 +- tests/checks/andor.fish | 2 +- tests/checks/argparse.fish | 2 +- tests/checks/bad-option.fish | 2 +- tests/checks/basic.fish | 2 +- tests/checks/bind.fish | 2 +- tests/checks/braces.fish | 2 +- tests/checks/broken-config.fish | 2 +- tests/checks/builtinbuiltin.fish | 2 +- tests/checks/caller-exit.fish | 2 +- tests/checks/caller-observer.fish | 2 +- tests/checks/cd.fish | 2 +- tests/checks/check-all-fish-files.fish | 2 +- tests/checks/check-completions.fish | 2 +- tests/checks/check-translations.fish | 2 +- tests/checks/cmdsub-limit.fish | 2 +- tests/checks/cmdsub.fish | 2 +- tests/checks/command-1.fish | 2 +- tests/checks/command-2.fish | 2 +- tests/checks/command-not-found.fish | 2 +- tests/checks/command-vars-persist.fish | 2 +- tests/checks/commandline.fish | 2 +- tests/checks/complete-group-order.fish | 2 +- tests/checks/complete.fish | 2 +- tests/checks/complete_directories.fish | 2 +- tests/checks/contains_opt.fish | 2 +- tests/checks/count.fish | 2 +- tests/checks/deep-cmdsub.fish | 2 +- tests/checks/default-setup-path.fish | 2 +- tests/checks/directory-redirect.fish | 2 +- tests/checks/disown-parent.fish | 2 +- tests/checks/empty.fish | 2 +- tests/checks/env.fish | 2 +- tests/checks/eval.fish | 2 +- tests/checks/exec.fish | 2 +- .../exit-status-with-closing-stderr.fish | 2 +- tests/checks/expansion.fish | 2 +- tests/checks/fds.fish | 2 +- .../features-ampersand-nobg-in-token1.fish | 2 +- tests/checks/features-nocaret1.fish | 2 +- tests/checks/features-nocaret2.fish | 2 +- tests/checks/features-nocaret3.fish | 2 +- tests/checks/features-nocaret4.fish | 2 +- tests/checks/features-percent-self1.fish | 2 +- tests/checks/features-percent-self2.fish | 2 +- tests/checks/features-qmark1.fish | 2 +- tests/checks/features-qmark2.fish | 2 +- .../features-string-backslashes-off.fish | 2 +- tests/checks/features-string-backslashes.fish | 2 +- tests/checks/fish_add_path.fish | 2 +- tests/checks/fish_exit.fish | 2 +- tests/checks/fish_user_paths.fish | 2 +- tests/checks/for.fish | 2 +- tests/checks/function-definition.fish | 2 +- tests/checks/function.fish | 2 +- tests/checks/functions.fish | 2 +- tests/checks/git.fish | 2 +- tests/checks/glob.fish | 2 +- tests/checks/history.fish | 2 +- tests/checks/indent.fish | 2 +- tests/checks/init-command-2.fish | 2 +- tests/checks/init-command-mix-ordering.fish | 2 +- tests/checks/init-command-mix.fish | 2 +- tests/checks/init-command.fish | 2 +- tests/checks/init-unreadable-cwd.fish | 2 +- tests/checks/invocation.fish | 2 +- tests/checks/job-control-noninteractive.fish | 2 +- tests/checks/job-control-not-a-tty.fish | 2 +- tests/checks/job-ids.fish | 2 +- tests/checks/jobs-are-escaped.fish | 2 +- tests/checks/jobs.fish | 2 +- tests/checks/line-continuation.fish | 2 +- tests/checks/line-number.fish | 2 +- tests/checks/locale-numeric.fish | 2 +- tests/checks/locale.fish | 2 +- tests/checks/loops.fish | 2 +- tests/checks/math.fish | 2 +- tests/checks/no-config.fish | 2 +- tests/checks/no-execute.fish | 2 +- tests/checks/noshebang.fish | 2 +- tests/checks/not.fish | 2 +- tests/checks/nuls.fish | 2 +- tests/checks/path.fish | 2 +- tests/checks/pipeline-pgroup.fish | 2 +- tests/checks/pipestatus.fish | 2 +- tests/checks/print-help.fish | 2 +- tests/checks/printf.fish | 2 +- tests/checks/prompt.fish | 2 +- tests/checks/psub.fish | 2 +- tests/checks/random.fish | 2 +- tests/checks/rc-returned.fish | 2 +- tests/checks/read.fish | 4 +- tests/checks/realpath.fish | 2 +- tests/checks/redirect.fish | 2 +- tests/checks/regex-import.fish | 2 +- tests/checks/return.fish | 14 ++++--- tests/checks/scoping.fish | 2 +- tests/checks/self-signal-usr1.fish | 2 +- tests/checks/set.fish | 42 ++++++++++--------- tests/checks/setenv.fish | 2 +- tests/checks/sigint.fish | 2 +- tests/checks/sigint2.fish | 2 +- tests/checks/signal.fish | 2 +- tests/checks/slices.fish | 2 +- tests/checks/stack-overflow.fish | 2 +- tests/checks/status-command.fish | 2 +- tests/checks/status-value.fish | 2 +- tests/checks/status.fish | 2 +- tests/checks/string-advanced.fish | 2 +- tests/checks/string.fish | 2 +- tests/checks/switch.fish | 2 +- tests/checks/symlinks-not-overwritten.fish | 2 +- tests/checks/syntax-error-location.fish | 2 +- tests/checks/test.fish | 2 +- tests/checks/threads.fish | 2 +- tests/checks/time.fish | 2 +- tests/checks/tmux-abbr.fish | 2 +- tests/checks/tmux-bind.fish | 2 +- tests/checks/tmux-commandline.fish | 2 +- tests/checks/tmux-complete.fish | 2 +- tests/checks/tmux-history-search.fish | 2 +- tests/checks/tmux-prompt.fish | 2 +- tests/checks/trace.fish | 2 +- tests/checks/trap.fish | 2 +- tests/checks/trap_print.fish | 2 +- tests/checks/type.fish | 2 +- tests/checks/ulimit.fish | 2 +- tests/checks/umask.fish | 2 +- tests/checks/variable-assignment.fish | 2 +- tests/checks/vars_as_commands.fish | 2 +- tests/checks/version.fish | 2 +- tests/checks/wait.fish | 2 +- tests/checks/wildcard.fish | 2 +- tests/checks/wraps.fish | 2 +- tests/checks/zero_based_array.fish | 2 +- ...trlseqs.sh => filter-control-sequences.sh} | 0 tests/test.fish | 2 +- 139 files changed, 167 insertions(+), 163 deletions(-) rename tests/{filter-ctrlseqs.sh => filter-control-sequences.sh} (100%) diff --git a/tests/checks/abbr.fish b/tests/checks/abbr.fish index 810b24868..3275022b4 100644 --- a/tests/checks/abbr.fish +++ b/tests/checks/abbr.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Universal abbreviations are imported. set -U _fish_abbr_cuckoo somevalue diff --git a/tests/checks/alias.fish b/tests/checks/alias.fish index f4145ac92..de725979d 100644 --- a/tests/checks/alias.fish +++ b/tests/checks/alias.fish @@ -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 function foo echo ran foo diff --git a/tests/checks/andandoror.fish b/tests/checks/andandoror.fish index 1492aad71..806315699 100644 --- a/tests/checks/andandoror.fish +++ b/tests/checks/andandoror.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # "Basic && and || support" echo first && echo second diff --git a/tests/checks/andor.fish b/tests/checks/andor.fish index 8e9fc3c33..c228c9ccf 100644 --- a/tests/checks/andor.fish +++ b/tests/checks/andor.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s set -xl LANG C # uniform quotes diff --git a/tests/checks/argparse.fish b/tests/checks/argparse.fish index e21e6da21..7b5745792 100644 --- a/tests/checks/argparse.fish +++ b/tests/checks/argparse.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s ########## # NOTE: This uses argparse, which touches the local variables. diff --git a/tests/checks/bad-option.fish b/tests/checks/bad-option.fish index 1df4328ff..df47065f6 100644 --- a/tests/checks/bad-option.fish +++ b/tests/checks/bad-option.fish @@ -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}} diff --git a/tests/checks/basic.fish b/tests/checks/basic.fish index 9297e15c1..eedc04035 100644 --- a/tests/checks/basic.fish +++ b/tests/checks/basic.fish @@ -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 # diff --git a/tests/checks/bind.fish b/tests/checks/bind.fish index 2b5c35bc6..3330da570 100644 --- a/tests/checks/bind.fish +++ b/tests/checks/bind.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s #REQUIRES: command -v diff set -l fish (status fish-path) diff --git a/tests/checks/braces.fish b/tests/checks/braces.fish index 30b82cf9f..061c3c45b 100644 --- a/tests/checks/braces.fish +++ b/tests/checks/braces.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s echo x-{1} #CHECK: x-{1} diff --git a/tests/checks/broken-config.fish b/tests/checks/broken-config.fish index 55ea784a0..28c471d56 100644 --- a/tests/checks/broken-config.fish +++ b/tests/checks/broken-config.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs +#RUN: %fish -C 'set -g fish %fish' %s begin set -l dir $PWD/(dirname (status -f)) set -gx XDG_CONFIG_HOME $dir/broken-config/ diff --git a/tests/checks/builtinbuiltin.fish b/tests/checks/builtinbuiltin.fish index 43c5fb0af..7c8e7193d 100644 --- a/tests/checks/builtinbuiltin.fish +++ b/tests/checks/builtinbuiltin.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Tests for the "builtin" builtin/keyword. builtin -q string; and echo String exists #CHECK: String exists diff --git a/tests/checks/caller-exit.fish b/tests/checks/caller-exit.fish index 6a4a88e36..d145589bc 100644 --- a/tests/checks/caller-exit.fish +++ b/tests/checks/caller-exit.fish @@ -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) # CHECK: caller-exit foo1 echo (function foo2 --on-job-exit caller; end; functions --handlers-type process-exit | grep foo) diff --git a/tests/checks/caller-observer.fish b/tests/checks/caller-observer.fish index 66a90dc89..3585ed3a8 100644 --- a/tests/checks/caller-observer.fish +++ b/tests/checks/caller-observer.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Verify the '--on-job-exit caller' misfeature. function make_call_observer -a type diff --git a/tests/checks/cd.fish b/tests/checks/cd.fish index cacf8a6e6..98a7757df 100644 --- a/tests/checks/cd.fish +++ b/tests/checks/cd.fish @@ -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) diff --git a/tests/checks/check-all-fish-files.fish b/tests/checks/check-all-fish-files.fish index 067f7836e..018c3d43c 100644 --- a/tests/checks/check-all-fish-files.fish +++ b/tests/checks/check-all-fish-files.fish @@ -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 # in share/, that is - the tests are exempt because they contain syntax errors, on purpose diff --git a/tests/checks/check-completions.fish b/tests/checks/check-completions.fish index 3bf2ec377..bffa5e344 100644 --- a/tests/checks/check-completions.fish +++ b/tests/checks/check-completions.fish @@ -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 # No output is good output diff --git a/tests/checks/check-translations.fish b/tests/checks/check-translations.fish index ec0c0428f..ba34ab2ad 100644 --- a/tests/checks/check-translations.fish +++ b/tests/checks/check-translations.fish @@ -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 set -l fail_count 0 diff --git a/tests/checks/cmdsub-limit.fish b/tests/checks/cmdsub-limit.fish index f53811384..ab3ee9bbf 100644 --- a/tests/checks/cmdsub-limit.fish +++ b/tests/checks/cmdsub-limit.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # This tests various corner cases involving command substitution. diff --git a/tests/checks/cmdsub.fish b/tests/checks/cmdsub.fish index 9e2424f00..84eb94bed 100644 --- a/tests/checks/cmdsub.fish +++ b/tests/checks/cmdsub.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s echo $(echo 1\n2) # CHECK: 1 2 diff --git a/tests/checks/command-1.fish b/tests/checks/command-1.fish index 273d861f4..d8ca460e5 100644 --- a/tests/checks/command-1.fish +++ b/tests/checks/command-1.fish @@ -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. diff --git a/tests/checks/command-2.fish b/tests/checks/command-2.fish index c9a64de1d..c0b4ef83d 100644 --- a/tests/checks/command-2.fish +++ b/tests/checks/command-2.fish @@ -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: 5.6.7.8. diff --git a/tests/checks/command-not-found.fish b/tests/checks/command-not-found.fish index 7f7e6ed80..cf6ce48cb 100644 --- a/tests/checks/command-not-found.fish +++ b/tests/checks/command-not-found.fish @@ -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 $fish -c "nonexistent-command-1234 banana rama" #CHECKERR: fish: Unknown command: nonexistent-command-1234 diff --git a/tests/checks/command-vars-persist.fish b/tests/checks/command-vars-persist.fish index 8662f9fea..c3670dd84 100644 --- a/tests/checks/command-vars-persist.fish +++ b/tests/checks/command-vars-persist.fish @@ -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 diff --git a/tests/checks/commandline.fish b/tests/checks/commandline.fish index 3ebf4d207..6562d5873 100644 --- a/tests/checks/commandline.fish +++ b/tests/checks/commandline.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s commandline --input "echo foo | bar" --is-valid and echo Valid diff --git a/tests/checks/complete-group-order.fish b/tests/checks/complete-group-order.fish index de50a48d7..6bb9a7f95 100644 --- a/tests/checks/complete-group-order.fish +++ b/tests/checks/complete-group-order.fish @@ -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; diff --git a/tests/checks/complete.fish b/tests/checks/complete.fish index 228d69713..1270d1713 100644 --- a/tests/checks/complete.fish +++ b/tests/checks/complete.fish @@ -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 echo $argv end diff --git a/tests/checks/complete_directories.fish b/tests/checks/complete_directories.fish index 65d9b4206..e5d2f283d 100644 --- a/tests/checks/complete_directories.fish +++ b/tests/checks/complete_directories.fish @@ -1,4 +1,4 @@ -#RUN: %fish --interactive %s | %filter-ctrlseqs +#RUN: %fish --interactive %s | %filter-control-sequences # ^ interactive so we can do `complete` mkdir -p __fish_complete_directories/ cd __fish_complete_directories diff --git a/tests/checks/contains_opt.fish b/tests/checks/contains_opt.fish index cb04179d2..3d4c66592 100644 --- a/tests/checks/contains_opt.fish +++ b/tests/checks/contains_opt.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s function commandline if test $argv[1] = -ct echo --long4\n-4 diff --git a/tests/checks/count.fish b/tests/checks/count.fish index 0902178a3..c66afbfcd 100644 --- a/tests/checks/count.fish +++ b/tests/checks/count.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Validate the behavior of the `count` command. # no args diff --git a/tests/checks/deep-cmdsub.fish b/tests/checks/deep-cmdsub.fish index d4e64d8d0..5a6ac7966 100644 --- a/tests/checks/deep-cmdsub.fish +++ b/tests/checks/deep-cmdsub.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Ensure we don't hang on deep command substitutions - see #6503. diff --git a/tests/checks/default-setup-path.fish b/tests/checks/default-setup-path.fish index 09750b7a5..8345abcae 100644 --- a/tests/checks/default-setup-path.fish +++ b/tests/checks/default-setup-path.fish @@ -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 # (no env -u, some systems don't support that) diff --git a/tests/checks/directory-redirect.fish b/tests/checks/directory-redirect.fish index 38d930cb6..b3219b6fb 100644 --- a/tests/checks/directory-redirect.fish +++ b/tests/checks/directory-redirect.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s begin end >. status -b; and echo "status -b returned true after bad redirect on a begin block" diff --git a/tests/checks/disown-parent.fish b/tests/checks/disown-parent.fish index 3ce48b78c..adfe8e344 100644 --- a/tests/checks/disown-parent.fish +++ b/tests/checks/disown-parent.fish @@ -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. # Here fish_test_helper is the process group leader; we attempt to disown diff --git a/tests/checks/empty.fish b/tests/checks/empty.fish index 0eecc256d..aa25cdb60 100644 --- a/tests/checks/empty.fish +++ b/tests/checks/empty.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # See issue 5692 diff --git a/tests/checks/env.fish b/tests/checks/env.fish index c8464129f..4741a45f6 100644 --- a/tests/checks/env.fish +++ b/tests/checks/env.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s function getenvs env | string match FISH_ENV_TEST_\* diff --git a/tests/checks/eval.fish b/tests/checks/eval.fish index ecef046c0..9552f5a4e 100644 --- a/tests/checks/eval.fish +++ b/tests/checks/eval.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Regression test for issue #4443 eval set -l previously_undefined foo echo $previously_undefined diff --git a/tests/checks/exec.fish b/tests/checks/exec.fish index e1e7d4dd8..ed7d8d5a2 100644 --- a/tests/checks/exec.fish +++ b/tests/checks/exec.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs +#RUN: %fish -C 'set -l fish %fish' %s exec cat /dev/null echo $status # CHECK: 2 diff --git a/tests/checks/expansion.fish b/tests/checks/expansion.fish index e48dbc030..1b6511ad4 100644 --- a/tests/checks/expansion.fish +++ b/tests/checks/expansion.fish @@ -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) printf '<%s>\n' ($fish -c ' $f[a]' 2>&1) diff --git a/tests/checks/fds.fish b/tests/checks/fds.fish index e32bb76d9..de581e4b2 100644 --- a/tests/checks/fds.fish +++ b/tests/checks/fds.fish @@ -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. diff --git a/tests/checks/features-ampersand-nobg-in-token1.fish b/tests/checks/features-ampersand-nobg-in-token1.fish index 9f1b0e5b9..bc352bb9e 100644 --- a/tests/checks/features-ampersand-nobg-in-token1.fish +++ b/tests/checks/features-ampersand-nobg-in-token1.fish @@ -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 # CHECK: no&background diff --git a/tests/checks/features-nocaret1.fish b/tests/checks/features-nocaret1.fish index 04ebcf5dd..c0b18c671 100644 --- a/tests/checks/features-nocaret1.fish +++ b/tests/checks/features-nocaret1.fish @@ -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 diff --git a/tests/checks/features-nocaret2.fish b/tests/checks/features-nocaret2.fish index 82579a0c1..7aa21462b 100644 --- a/tests/checks/features-nocaret2.fish +++ b/tests/checks/features-nocaret2.fish @@ -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 diff --git a/tests/checks/features-nocaret3.fish b/tests/checks/features-nocaret3.fish index b4e06e695..ed4575452 100644 --- a/tests/checks/features-nocaret3.fish +++ b/tests/checks/features-nocaret3.fish @@ -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 diff --git a/tests/checks/features-nocaret4.fish b/tests/checks/features-nocaret4.fish index c02a9a160..1f538cdb5 100644 --- a/tests/checks/features-nocaret4.fish +++ b/tests/checks/features-nocaret4.fish @@ -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 diff --git a/tests/checks/features-percent-self1.fish b/tests/checks/features-percent-self1.fish index f6f6c4262..0c36161d0 100644 --- a/tests/checks/features-percent-self1.fish +++ b/tests/checks/features-percent-self1.fish @@ -1,4 +1,4 @@ -#RUN: %fish --features=remove-percent-self %s | %filter-ctrlseqs +#RUN: %fish --features=remove-percent-self %s echo %self # CHECK: %self diff --git a/tests/checks/features-percent-self2.fish b/tests/checks/features-percent-self2.fish index 6737ee3f2..e315a752d 100644 --- a/tests/checks/features-percent-self2.fish +++ b/tests/checks/features-percent-self2.fish @@ -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 diff --git a/tests/checks/features-qmark1.fish b/tests/checks/features-qmark1.fish index 7191372bb..b0ebdb03d 100644 --- a/tests/checks/features-qmark1.fish +++ b/tests/checks/features-qmark1.fish @@ -1,3 +1,3 @@ # 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 diff --git a/tests/checks/features-qmark2.fish b/tests/checks/features-qmark2.fish index 5a8424ac1..36dd56528 100644 --- a/tests/checks/features-qmark2.fish +++ b/tests/checks/features-qmark2.fish @@ -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 diff --git a/tests/checks/features-string-backslashes-off.fish b/tests/checks/features-string-backslashes-off.fish index 3af9b8196..233cdcfc4 100644 --- a/tests/checks/features-string-backslashes-off.fish +++ b/tests/checks/features-string-backslashes-off.fish @@ -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 diff --git a/tests/checks/features-string-backslashes.fish b/tests/checks/features-string-backslashes.fish index 9fd5d1c4e..596a12bd1 100644 --- a/tests/checks/features-string-backslashes.fish +++ b/tests/checks/features-string-backslashes.fish @@ -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 diff --git a/tests/checks/fish_add_path.fish b/tests/checks/fish_add_path.fish index f10da460a..d47fef959 100644 --- a/tests/checks/fish_add_path.fish +++ b/tests/checks/fish_add_path.fish @@ -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. diff --git a/tests/checks/fish_exit.fish b/tests/checks/fish_exit.fish index a40bb9a29..77d063c3d 100644 --- a/tests/checks/fish_exit.fish +++ b/tests/checks/fish_exit.fish @@ -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. echo 'function do_exit --on-event fish_exit; echo "fish_exiting $fish_pid"; end' > /tmp/test_exit.fish diff --git a/tests/checks/fish_user_paths.fish b/tests/checks/fish_user_paths.fish index 803fffd12..2ffd7a735 100644 --- a/tests/checks/fish_user_paths.fish +++ b/tests/checks/fish_user_paths.fish @@ -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. diff --git a/tests/checks/for.fish b/tests/checks/for.fish index ad106f48f..139ab1ff9 100644 --- a/tests/checks/for.fish +++ b/tests/checks/for.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # A for-loop-variable is a local variable in the enclosing scope. set -g i global diff --git a/tests/checks/function-definition.fish b/tests/checks/function-definition.fish index 443de84b8..9ee933f05 100644 --- a/tests/checks/function-definition.fish +++ b/tests/checks/function-definition.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s function stuff --argument a b c # This is a comment diff --git a/tests/checks/function.fish b/tests/checks/function.fish index b901c754f..e665e89ec 100644 --- a/tests/checks/function.fish +++ b/tests/checks/function.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s function t --argument-names a b c echo t end diff --git a/tests/checks/functions.fish b/tests/checks/functions.fish index 82812371f..4ed058ea7 100644 --- a/tests/checks/functions.fish +++ b/tests/checks/functions.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Test the `functions` builtin function f1 diff --git a/tests/checks/git.fish b/tests/checks/git.fish index d45f59765..0a4da467e 100644 --- a/tests/checks/git.fish +++ b/tests/checks/git.fish @@ -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, # e.g. the fish_git_prompt variable handlers test `status is-interactive`. #REQUIRES: command -v git diff --git a/tests/checks/glob.fish b/tests/checks/glob.fish index e160cbd63..bb75d23e0 100644 --- a/tests/checks/glob.fish +++ b/tests/checks/glob.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s set -l oldpwd $PWD cd (mktemp -d) diff --git a/tests/checks/history.fish b/tests/checks/history.fish index 42307b14c..53a62d463 100644 --- a/tests/checks/history.fish +++ b/tests/checks/history.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Verify that specifying unexpected options or arguments results in an error. # First using the legacy, now deprecated, long options to specify a diff --git a/tests/checks/indent.fish b/tests/checks/indent.fish index 0014e719e..d6a828e51 100644 --- a/tests/checks/indent.fish +++ b/tests/checks/indent.fish @@ -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 # Note that littlecheck ignores leading whitespace, so we have to use {{ }} to explicitly match it. diff --git a/tests/checks/init-command-2.fish b/tests/checks/init-command-2.fish index 901e4d3ea..0e603deb2 100644 --- a/tests/checks/init-command-2.fish +++ b/tests/checks/init-command-2.fish @@ -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: 2nd init-command diff --git a/tests/checks/init-command-mix-ordering.fish b/tests/checks/init-command-mix-ordering.fish index 954a94f75..8c54be6e6 100644 --- a/tests/checks/init-command-mix-ordering.fish +++ b/tests/checks/init-command-mix-ordering.fish @@ -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: command diff --git a/tests/checks/init-command-mix.fish b/tests/checks/init-command-mix.fish index e36b8334f..a8cd076bf 100644 --- a/tests/checks/init-command-mix.fish +++ b/tests/checks/init-command-mix.fish @@ -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: command diff --git a/tests/checks/init-command.fish b/tests/checks/init-command.fish index 6af8ab797..0a7875e1a 100644 --- a/tests/checks/init-command.fish +++ b/tests/checks/init-command.fish @@ -1,2 +1,2 @@ -#RUN: %fish -C 'echo init-command' | %filter-ctrlseqs +#RUN: %fish -C 'echo init-command' # CHECK: init-command diff --git a/tests/checks/init-unreadable-cwd.fish b/tests/checks/init-unreadable-cwd.fish index 2aa0a8086..c30843a22 100644 --- a/tests/checks/init-unreadable-cwd.fish +++ b/tests/checks/init-unreadable-cwd.fish @@ -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) set -l oldpwd $PWD diff --git a/tests/checks/invocation.fish b/tests/checks/invocation.fish index 702eadd5b..3cb9b964d 100644 --- a/tests/checks/invocation.fish +++ b/tests/checks/invocation.fish @@ -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." # CHECK: 1.2.3.4. diff --git a/tests/checks/job-control-noninteractive.fish b/tests/checks/job-control-noninteractive.fish index 2540bd5e2..da4566306 100644 --- a/tests/checks/job-control-noninteractive.fish +++ b/tests/checks/job-control-noninteractive.fish @@ -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. diff --git a/tests/checks/job-control-not-a-tty.fish b/tests/checks/job-control-not-a-tty.fish index e9d301f57..80b780549 100644 --- a/tests/checks/job-control-not-a-tty.fish +++ b/tests/checks/job-control-not-a-tty.fish @@ -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. diff --git a/tests/checks/job-ids.fish b/tests/checks/job-ids.fish index 39190d03a..e94d2d800 100644 --- a/tests/checks/job-ids.fish +++ b/tests/checks/job-ids.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Ensure that job IDs are sequential. diff --git a/tests/checks/jobs-are-escaped.fish b/tests/checks/jobs-are-escaped.fish index df59b2d57..76a8722c1 100644 --- a/tests/checks/jobs-are-escaped.fish +++ b/tests/checks/jobs-are-escaped.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Ensure that jobs are printed with new lines escaped diff --git a/tests/checks/jobs.fish b/tests/checks/jobs.fish index d3f4ddaeb..7f85f0861 100644 --- a/tests/checks/jobs.fish +++ b/tests/checks/jobs.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Verify zombies are not left by disown (#7183, #5342) # Do this first to avoid colliding with the other disowned processes below, which may diff --git a/tests/checks/line-continuation.fish b/tests/checks/line-continuation.fish index 3d46b5b8f..37e11a41a 100644 --- a/tests/checks/line-continuation.fish +++ b/tests/checks/line-continuation.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s ech\ o echo #CHECK: echo diff --git a/tests/checks/line-number.fish b/tests/checks/line-number.fish index 2714dbe25..c5832db9a 100644 --- a/tests/checks/line-number.fish +++ b/tests/checks/line-number.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # # These lines left around because we need the line numbers. # This file in general requires careful editing in the middle, I recommend appending. diff --git a/tests/checks/locale-numeric.fish b/tests/checks/locale-numeric.fish index 0d797b68c..91b00bcc8 100644 --- a/tests/checks/locale-numeric.fish +++ b/tests/checks/locale-numeric.fish @@ -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. # REQUIRES: command -v locale # We need a comma-using locale we know. diff --git a/tests/checks/locale.fish b/tests/checks/locale.fish index 7b4349557..5f8cf6290 100644 --- a/tests/checks/locale.fish +++ b/tests/checks/locale.fish @@ -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, # see #7934. #REQUIRES: test -z "$GITHUB_WORKFLOW" diff --git a/tests/checks/loops.fish b/tests/checks/loops.fish index f889a937f..aea9d7e3a 100644 --- a/tests/checks/loops.fish +++ b/tests/checks/loops.fish @@ -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 while false diff --git a/tests/checks/math.fish b/tests/checks/math.fish index c62d2b183..bcfadd955 100644 --- a/tests/checks/math.fish +++ b/tests/checks/math.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # OpenBSD doesn't do hex numbers in str/wcstod (like C99 requires). # So let's skip this. #REQUIRES: test "$(uname)" != OpenBSD diff --git a/tests/checks/no-config.fish b/tests/checks/no-config.fish index 0a1e64a4f..622617d6c 100644 --- a/tests/checks/no-config.fish +++ b/tests/checks/no-config.fish @@ -1,4 +1,4 @@ -#RUN: %fish --no-config %s | %filter-ctrlseqs +#RUN: %fish --no-config %s functions | string match help # CHECK: help diff --git a/tests/checks/no-execute.fish b/tests/checks/no-execute.fish index 867b0d619..1e5f54e01 100644 --- a/tests/checks/no-execute.fish +++ b/tests/checks/no-execute.fish @@ -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. echo "type foo" | $fish -n diff --git a/tests/checks/noshebang.fish b/tests/checks/noshebang.fish index 9bc9ae59d..008723f35 100644 --- a/tests/checks/noshebang.fish +++ b/tests/checks/noshebang.fish @@ -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 # which mishandles shebangless scripts. diff --git a/tests/checks/not.fish b/tests/checks/not.fish index 3a121d227..77a03c419 100644 --- a/tests/checks/not.fish +++ b/tests/checks/not.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s not true echo $status diff --git a/tests/checks/nuls.fish b/tests/checks/nuls.fish index 560fee041..fa2194787 100644 --- a/tests/checks/nuls.fish +++ b/tests/checks/nuls.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # NUL-handling # This one actually prints a NUL diff --git a/tests/checks/path.fish b/tests/checks/path.fish index 95135e4ba..f8c326acc 100644 --- a/tests/checks/path.fish +++ b/tests/checks/path.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # The "path" builtin for dealing with paths # Extension - for figuring out the file extension of a given path. diff --git a/tests/checks/pipeline-pgroup.fish b/tests/checks/pipeline-pgroup.fish index e94eab239..07da18829 100644 --- a/tests/checks/pipeline-pgroup.fish +++ b/tests/checks/pipeline-pgroup.fish @@ -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 diff --git a/tests/checks/pipestatus.fish b/tests/checks/pipestatus.fish index 5a093fa31..bfe799306 100644 --- a/tests/checks/pipestatus.fish +++ b/tests/checks/pipestatus.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # pipestatus variable - builtins only false | false | false diff --git a/tests/checks/print-help.fish b/tests/checks/print-help.fish index 1d12ec184..fcd0e1327 100644 --- a/tests/checks/print-help.fish +++ b/tests/checks/print-help.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Test redirecting builtin help with a pipe set -lx __fish_data_dir (mktemp -d) diff --git a/tests/checks/printf.fish b/tests/checks/printf.fish index 9664116b4..f1cc238e1 100644 --- a/tests/checks/printf.fish +++ b/tests/checks/printf.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s printf "%d %d\n" 1 2 3 # CHECK: 1 2 diff --git a/tests/checks/prompt.fish b/tests/checks/prompt.fish index b9be6362f..a600dfff0 100644 --- a/tests/checks/prompt.fish +++ b/tests/checks/prompt.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s prompt_pwd -d 1 /foo/bar/baz # CHECK: /f/b/baz diff --git a/tests/checks/psub.fish b/tests/checks/psub.fish index e8cda45dd..d277072e2 100644 --- a/tests/checks/psub.fish +++ b/tests/checks/psub.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s set -l filename (echo foo | psub --testing) test -f $filename or echo 'psub is not a regular file' >&2 diff --git a/tests/checks/random.fish b/tests/checks/random.fish index 591d79ed2..712313686 100644 --- a/tests/checks/random.fish +++ b/tests/checks/random.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s set -l max 9223372036854775807 set -l close_max 9223372036854775806 set -l min -9223372036854775807 diff --git a/tests/checks/rc-returned.fish b/tests/checks/rc-returned.fish index 88aead42c..240e28ea1 100644 --- a/tests/checks/rc-returned.fish +++ b/tests/checks/rc-returned.fish @@ -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 diff --git a/tests/checks/read.fish b/tests/checks/read.fish index 1c8c1dbaa..2f6c9a454 100644 --- a/tests/checks/read.fish +++ b/tests/checks/read.fish @@ -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 -gx TERM xterm # Read with no vars is not an error @@ -248,7 +248,7 @@ if test (string length "$x") -ne $fish_read_limit end # 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[1]: |abc| #CHECK: $b: set in global scope, unexported, with 1 elements diff --git a/tests/checks/realpath.fish b/tests/checks/realpath.fish index b521c8632..2f4dfbf54 100644 --- a/tests/checks/realpath.fish +++ b/tests/checks/realpath.fish @@ -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 # 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 diff --git a/tests/checks/redirect.fish b/tests/checks/redirect.fish index f94726192..d4d9628f5 100644 --- a/tests/checks/redirect.fish +++ b/tests/checks/redirect.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s function outnerr command echo out $argv diff --git a/tests/checks/regex-import.fish b/tests/checks/regex-import.fish index 56dc0a0f9..4905a79d0 100644 --- a/tests/checks/regex-import.fish +++ b/tests/checks/regex-import.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Tests for importing named regex groups as fish variables # Invalid variable name? diff --git a/tests/checks/return.fish b/tests/checks/return.fish index cb49fcc74..1c638901c 100644 --- a/tests/checks/return.fish +++ b/tests/checks/return.fish @@ -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. $fish -c 'return 5' @@ -15,11 +15,13 @@ $fish -c 'echo foo; return 2; echo bar' echo $status # CHECK: 2 -$fish -ic 'echo interactive-foo; return 69; echo interactive-bar' -# CHECK: interactive-foo -# but not bar -echo $status -# CHECK: 69 +begin + $fish -ic 'echo interactive-foo; return 69; echo interactive-bar' + # CHECK: interactive-foo + # but not bar + echo $status + # CHECK: 69 +end | $filter_ctrls # Verify negative return values don't cause UB and never map to 0 function empty_return diff --git a/tests/checks/scoping.fish b/tests/checks/scoping.fish index 480776cdc..f2547580a 100644 --- a/tests/checks/scoping.fish +++ b/tests/checks/scoping.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Test scoping rules for functions and status set -e smurf diff --git a/tests/checks/self-signal-usr1.fish b/tests/checks/self-signal-usr1.fish index 261189fc3..15d45ee6b 100644 --- a/tests/checks/self-signal-usr1.fish +++ b/tests/checks/self-signal-usr1.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # See #6397 diff --git a/tests/checks/set.fish b/tests/checks/set.fish index 0b1b8347a..2236b221b 100644 --- a/tests/checks/set.fish +++ b/tests/checks/set.fish @@ -1,5 +1,5 @@ # Explicitly overriding HOME/XDG_CONFIG_HOME is only required if not invoking via `make test` -# RUN: env FISH=%fish %fish %s | %filter-ctrlseqs +# RUN: env FISH=%fish %fish -C 'set -l filter_ctrls %filter-control-sequences' %s # Environment variable tests # Test if variables can be properly set @@ -346,27 +346,29 @@ or echo testu undef in top level shell $FISH -c 'set -q testu; or echo testu undef in sub shell' # CHECK: testu undef in sub shell -# test SHLVL -# use a subshell to ensure a clean slate -env SHLVL= $FISH -ic 'echo SHLVL: $SHLVL; $FISH -ic \'echo SHLVL: $SHLVL\'' -# CHECK: SHLVL: 1 -# CHECK: SHLVL: 2 +begin + # test SHLVL + # use a subshell to ensure a clean slate + env SHLVL= $FISH -ic 'echo SHLVL: $SHLVL; $FISH -ic \'echo SHLVL: $SHLVL\'' + # CHECK: SHLVL: 1 + # CHECK: SHLVL: 2 -# exec should decrement SHLVL - outer fish increments by 1, decrements for exec, -# inner fish increments again so the value stays the same. -env SHLVL=1 $FISH -ic 'echo SHLVL: $SHLVL; exec $FISH -ic \'echo SHLVL: $SHLVL\'' -# CHECK: SHLVL: 2 -# CHECK: SHLVL: 2 + # exec should decrement SHLVL - outer fish increments by 1, decrements for exec, + # inner fish increments again so the value stays the same. + env SHLVL=1 $FISH -ic 'echo SHLVL: $SHLVL; exec $FISH -ic \'echo SHLVL: $SHLVL\'' + # CHECK: SHLVL: 2 + # CHECK: SHLVL: 2 -# garbage SHLVLs should be treated as garbage -env SHLVL=3foo $FISH -ic 'echo SHLVL: $SHLVL' -# CHECK: SHLVL: 1 + # garbage SHLVLs should be treated as garbage + env SHLVL=3foo $FISH -ic 'echo SHLVL: $SHLVL' + # CHECK: SHLVL: 1 -# whitespace is allowed though (for bash compatibility) -env SHLVL="3 " $FISH -ic 'echo SHLVL: $SHLVL' -env SHLVL=" 3" $FISH -ic 'echo SHLVL: $SHLVL' -# CHECK: SHLVL: 4 -# CHECK: SHLVL: 4 + # whitespace is allowed though (for bash compatibility) + env SHLVL="3 " $FISH -ic 'echo SHLVL: $SHLVL' + env SHLVL=" 3" $FISH -ic 'echo SHLVL: $SHLVL' + # CHECK: SHLVL: 4 + # CHECK: SHLVL: 4 +end | $filter_ctrls # Non-interactive fish doesn't touch $SHLVL env SHLVL=2 $FISH -c 'echo SHLVL: $SHLVL' @@ -951,7 +953,7 @@ end set -e undefined[x..] # CHECKERR: set: Invalid index starting at 'undefined' -# CHECKERR: checks/set.fish (line 952): +# CHECKERR: checks/set.fish (line 954): # CHECKERR: set -e undefined[x..] # CHECKERR: ^ # CHECKERR: (Type 'help set' for related documentation) diff --git a/tests/checks/setenv.fish b/tests/checks/setenv.fish index 528c68528..f65fa74c1 100644 --- a/tests/checks/setenv.fish +++ b/tests/checks/setenv.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Verify the correct behavior of the `setenv` compatibility shim. diff --git a/tests/checks/sigint.fish b/tests/checks/sigint.fish index 25fa56247..7838ece07 100644 --- a/tests/checks/sigint.fish +++ b/tests/checks/sigint.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C "set -g helper %fish_test_helper; set -g fish %fish" %s | %filter-ctrlseqs +#RUN: %fish -C "set -g helper %fish_test_helper; set -g fish %fish" %s # Check that nohup is propagated. set output_path (mktemp) diff --git a/tests/checks/sigint2.fish b/tests/checks/sigint2.fish index 17643f76c..0160cf3b5 100644 --- a/tests/checks/sigint2.fish +++ b/tests/checks/sigint2.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C "set helper %fish_test_helper" %s | %filter-ctrlseqs +#RUN: %fish -C "set helper %fish_test_helper" %s # This hangs on OpenBSD #REQUIRES: test "$(uname)" != OpenBSD diff --git a/tests/checks/signal.fish b/tests/checks/signal.fish index 88a7601e1..20d0fd6c2 100644 --- a/tests/checks/signal.fish +++ b/tests/checks/signal.fish @@ -1,4 +1,4 @@ -# RUN: env fish_test_helper=%fish_test_helper %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs +# RUN: env fish_test_helper=%fish_test_helper %fish -C 'set -l fish %fish' %s $fish -c 'function main; exit 4; true; end; main' echo $status diff --git a/tests/checks/slices.fish b/tests/checks/slices.fish index c971a959b..44b25870b 100644 --- a/tests/checks/slices.fish +++ b/tests/checks/slices.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s set n 10 set test (seq $n) echo $test[1..$n] # normal range diff --git a/tests/checks/stack-overflow.fish b/tests/checks/stack-overflow.fish index f83392467..de2189012 100644 --- a/tests/checks/stack-overflow.fish +++ b/tests/checks/stack-overflow.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Check that we correctly detect an overflow of fish's function stack. # This is dependent on the internal max stack depth of course. diff --git a/tests/checks/status-command.fish b/tests/checks/status-command.fish index acf4c9b62..c6105dea2 100644 --- a/tests/checks/status-command.fish +++ b/tests/checks/status-command.fish @@ -1,4 +1,4 @@ -#RUN: env FISH_PATH=%fish FILE_PATH=%s %fish %s | %filter-ctrlseqs +#RUN: env FISH_PATH=%fish FILE_PATH=%s %fish %s status line-number # CHECK: 3 diff --git a/tests/checks/status-value.fish b/tests/checks/status-value.fish index 56c00b9a5..ce02a45ad 100644 --- a/tests/checks/status-value.fish +++ b/tests/checks/status-value.fish @@ -1,4 +1,4 @@ -# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs +# RUN: %fish -C 'set -g fish %fish' %s # Empty commands should be 123 set empty_var diff --git a/tests/checks/status.fish b/tests/checks/status.fish index 5c1ad447f..733dd2260 100644 --- a/tests/checks/status.fish +++ b/tests/checks/status.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s status -b and echo '"status -b" unexpectedly returned true at top level' diff --git a/tests/checks/string-advanced.fish b/tests/checks/string-advanced.fish index 22e5c9ffa..22102f776 100644 --- a/tests/checks/string-advanced.fish +++ b/tests/checks/string-advanced.fish @@ -1,3 +1,3 @@ -#RUN: %fish --features regex-easyesc %s | %filter-ctrlseqs +#RUN: %fish --features regex-easyesc %s string replace -r 'a(.*)' '\U$0\E' abc # CHECK: ABC diff --git a/tests/checks/string.fish b/tests/checks/string.fish index b56bd7c0e..b24e5c706 100644 --- a/tests/checks/string.fish +++ b/tests/checks/string.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Tests for string builtin. Mostly taken from man page examples. string match -r -v "c.*" dog can cat diz; and echo "exit 0" diff --git a/tests/checks/switch.fish b/tests/checks/switch.fish index b6ea3cfcc..b5393c30e 100644 --- a/tests/checks/switch.fish +++ b/tests/checks/switch.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C "set fish %fish" %s | %filter-ctrlseqs +#RUN: %fish -C "set fish %fish" %s # Check that switch with an argument expanding to nothing still works. switch $foo case a diff --git a/tests/checks/symlinks-not-overwritten.fish b/tests/checks/symlinks-not-overwritten.fish index 7427ff32e..b5c6c5a27 100644 --- a/tests/checks/symlinks-not-overwritten.fish +++ b/tests/checks/symlinks-not-overwritten.fish @@ -1,5 +1,5 @@ # Explicitly overriding HOME/XDG_CONFIG_HOME is only required if not invoking via `make test` -# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs +# RUN: %fish -C 'set -g fish %fish' %s mkdir -p $XDG_CONFIG_HOME/fish diff --git a/tests/checks/syntax-error-location.fish b/tests/checks/syntax-error-location.fish index 61b7057c5..9821d752d 100644 --- a/tests/checks/syntax-error-location.fish +++ b/tests/checks/syntax-error-location.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs +#RUN: %fish -C 'set -g fish %fish' %s # A $status used as a command should not impact the location of other errors. echo 'echo foo | exec grep # this exec is not allowed! diff --git a/tests/checks/test.fish b/tests/checks/test.fish index 0fc9552b2..5a1cb09b4 100644 --- a/tests/checks/test.fish +++ b/tests/checks/test.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # # Tests for the `test` builtin, aka `[`. test inf -gt 0 diff --git a/tests/checks/threads.fish b/tests/checks/threads.fish index 0eb47f5ac..024bf77db 100644 --- a/tests/checks/threads.fish +++ b/tests/checks/threads.fish @@ -1,3 +1,3 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Check we can handle more than 64 threads (if not this HANGS!): true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true (true ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) diff --git a/tests/checks/time.fish b/tests/checks/time.fish index 0af7ad762..f4fe070e1 100644 --- a/tests/checks/time.fish +++ b/tests/checks/time.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs +#RUN: %fish -C 'set -l fish %fish' %s time sleep 0 # These are a tad awkward because it picks the correct unit and adapts whitespace. diff --git a/tests/checks/tmux-abbr.fish b/tests/checks/tmux-abbr.fish index 055f9dbf0..c8af9fe51 100644 --- a/tests/checks/tmux-abbr.fish +++ b/tests/checks/tmux-abbr.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s #REQUIRES: command -v tmux set -g isolated_tmux_fish_extra_args -C ' diff --git a/tests/checks/tmux-bind.fish b/tests/checks/tmux-bind.fish index 3ec9aa158..54c8f4f6f 100644 --- a/tests/checks/tmux-bind.fish +++ b/tests/checks/tmux-bind.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s #REQUIRES: command -v tmux isolated-tmux-start diff --git a/tests/checks/tmux-commandline.fish b/tests/checks/tmux-commandline.fish index a006be308..0ae7a03ac 100644 --- a/tests/checks/tmux-commandline.fish +++ b/tests/checks/tmux-commandline.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s #REQUIRES: command -v tmux isolated-tmux-start diff --git a/tests/checks/tmux-complete.fish b/tests/checks/tmux-complete.fish index 9902d3973..28210bd54 100644 --- a/tests/checks/tmux-complete.fish +++ b/tests/checks/tmux-complete.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s #REQUIRES: command -v tmux #REQUIRES: uname -r | grep -qv Microsoft # disable on github actions because it's flakey diff --git a/tests/checks/tmux-history-search.fish b/tests/checks/tmux-history-search.fish index e2d7704bd..6f16a3ead 100644 --- a/tests/checks/tmux-history-search.fish +++ b/tests/checks/tmux-history-search.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s #REQUIRES: command -v tmux # disable on github actions because it's flakey #REQUIRES: test -z "$CI" diff --git a/tests/checks/tmux-prompt.fish b/tests/checks/tmux-prompt.fish index 90c049250..e1f129e56 100644 --- a/tests/checks/tmux-prompt.fish +++ b/tests/checks/tmux-prompt.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s #REQUIRES: command -v tmux set -g isolated_tmux_fish_extra_args -C ' diff --git a/tests/checks/trace.fish b/tests/checks/trace.fish index 126ec0aea..737655fc8 100644 --- a/tests/checks/trace.fish +++ b/tests/checks/trace.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s echo untraced # CHECK: untraced diff --git a/tests/checks/trap.fish b/tests/checks/trap.fish index 2970ddafe..0b7def74d 100644 --- a/tests/checks/trap.fish +++ b/tests/checks/trap.fish @@ -1,4 +1,4 @@ -# RUN: env fth=%fish_test_helper %fish %s | %filter-ctrlseqs +# RUN: env fth=%fish_test_helper %fish %s set -g SIGUSR1_COUNT 0 diff --git a/tests/checks/trap_print.fish b/tests/checks/trap_print.fish index a8ae83fa2..0319a9bf8 100644 --- a/tests/checks/trap_print.fish +++ b/tests/checks/trap_print.fish @@ -1,4 +1,4 @@ -# RUN: env fth=%fish_test_helper %fish %s | %filter-ctrlseqs +# RUN: env fth=%fish_test_helper %fish %s # These tests check how installed trap handlers are listed. Run separately from the main trap # handler to ensure a clean environment. diff --git a/tests/checks/type.fish b/tests/checks/type.fish index 116b8a724..a872b5798 100644 --- a/tests/checks/type.fish +++ b/tests/checks/type.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # # Tests for the `type` builtin # First type --query, which is the most important part. diff --git a/tests/checks/ulimit.fish b/tests/checks/ulimit.fish index 6c7dc98d3..ad3b2f7a2 100644 --- a/tests/checks/ulimit.fish +++ b/tests/checks/ulimit.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s ulimit --core-size #CHECK: {{unlimited|\d+}} diff --git a/tests/checks/umask.fish b/tests/checks/umask.fish index 0d31cd48f..6bc3f895f 100644 --- a/tests/checks/umask.fish +++ b/tests/checks/umask.fish @@ -1,4 +1,4 @@ -# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs +# RUN: %fish -C 'set -g fish %fish' %s # Test the umask command. In particular the symbolic modes since they've been # broken for four years (see issue #738) at the time I added these tests. diff --git a/tests/checks/variable-assignment.fish b/tests/checks/variable-assignment.fish index 2f8d2bfd8..d5fb6b6ef 100644 --- a/tests/checks/variable-assignment.fish +++ b/tests/checks/variable-assignment.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # erase all lowercase variables to make sure they don't break our tests for varname in (set -xn | string match -r '^[a-z].*') diff --git a/tests/checks/vars_as_commands.fish b/tests/checks/vars_as_commands.fish index 03ce91a59..0c74fa747 100644 --- a/tests/checks/vars_as_commands.fish +++ b/tests/checks/vars_as_commands.fish @@ -1,4 +1,4 @@ -#RUN: %fish -C 'set -g fish (builtin realpath %fish)' %s | %filter-ctrlseqs +#RUN: %fish -C 'set -g fish (builtin realpath %fish)' %s # Test that using variables as command names work correctly. $EMPTY_VARIABLE diff --git a/tests/checks/version.fish b/tests/checks/version.fish index bc77ad08a..2c9424dec 100644 --- a/tests/checks/version.fish +++ b/tests/checks/version.fish @@ -1,2 +1,2 @@ -#RUN: %fish -v | %filter-ctrlseqs +#RUN: %fish -v # CHECK: fish, version {{[-.ga-f0-9]*(irty)?}} diff --git a/tests/checks/wait.fish b/tests/checks/wait.fish index c7bdf63fb..db28c179f 100644 --- a/tests/checks/wait.fish +++ b/tests/checks/wait.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Ensure that we can wait for stuff. status job-control full diff --git a/tests/checks/wildcard.fish b/tests/checks/wildcard.fish index f7b52d964..ee9e4d667 100644 --- a/tests/checks/wildcard.fish +++ b/tests/checks/wildcard.fish @@ -1,4 +1,4 @@ -# RUN: %fish %s | %filter-ctrlseqs +# RUN: %fish %s # Ensure that, if variable expansion results in multiple strings # and one of them fails a glob, that we don't fail the entire expansion. diff --git a/tests/checks/wraps.fish b/tests/checks/wraps.fish index 76197644c..9c93e3420 100644 --- a/tests/checks/wraps.fish +++ b/tests/checks/wraps.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s # Validate some things about command wrapping. set -g LANG C # For predictable error messages. diff --git a/tests/checks/zero_based_array.fish b/tests/checks/zero_based_array.fish index 0e20949c0..20992674a 100644 --- a/tests/checks/zero_based_array.fish +++ b/tests/checks/zero_based_array.fish @@ -1,4 +1,4 @@ -#RUN: %fish %s | %filter-ctrlseqs +#RUN: %fish %s echo $foo[0] #CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0. #CHECKERR: echo $foo[0] diff --git a/tests/filter-ctrlseqs.sh b/tests/filter-control-sequences.sh similarity index 100% rename from tests/filter-ctrlseqs.sh rename to tests/filter-control-sequences.sh diff --git a/tests/test.fish b/tests/test.fish index 05df28a1d..ec3b49916 100644 --- a/tests/test.fish +++ b/tests/test.fish @@ -42,7 +42,7 @@ if set -q files_to_test[1] --progress $force_color \ -s fish=../test/root/bin/fish \ -s fish_test_helper=../test/root/bin/fish_test_helper \ - -s filter-ctrlseqs='../tests/filter-ctrlseqs.sh ../test/root/bin/fish' \ + -s filter-control-sequences='../tests/filter-control-sequences.sh ../test/root/bin/fish' \ $files_to_test set -l littlecheck_status $status