fish-shell/tests/checks
Johannes Altmanninger 4f3d6427ce Fix regression causing crash in "commandline -j"
Commit 3fcc6482cb (Fix parse_util_process_extent including too much
on the left, 2024-12-24) changed the process extent based on the
observation that "A\n\n\nB" comprises three tokens with ranges 0..1,
1..2 and 4..5. Prior to that commit, the second process extent was
2..5, which seems a bit weird because it includes newlines.

Weirdness aside, the real reason for changing it was this snippet in
the autosuggestion performer, where we compute the process extent
around cursor, and check if the line at process start matches the
cached search string.

        // Search history for a matching item unless this line is not a continuation line or quoted.
        if range_of_line_at_cursor(
            &command_line,
            parse_util_process_extent(&command_line, cursor_pos, None).start,
        ) == search_string_range

Given "A\n\n\nB" and cursor_pos=1 commit 3fcc6482cb changed the output
from 2..5 to 4..5. This brings problems:
1. leading spaces will not be included (which is probably
   inconsequential but still ugly).
2. the specified cursor position is not included in the given range.

We could paper over 2 by computing min(cursor_pos)
but that would leave 1.

For now let's revert and solve the autosuggestion issue in a less
brittle way.
2025-01-12 19:55:17 +01:00
..
broken-config/fish Port config tests to littlecheck 2019-06-25 22:31:06 +02:00
abbr.fish Tests: Don't cd to the tests directory! 2025-01-01 16:45:43 +01:00
alias.fish Support quoted escaping also when ' or \ is present 2024-04-13 15:33:05 +02:00
andandoror.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
andor.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
argparse.fish Tests: Don't cd to the tests directory! 2025-01-01 16:45:43 +01:00
bad-option.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
basic.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
bind.fish Escape nonprintable characters when reporting invalid key name 2024-04-18 23:27:05 +02:00
braces.fish Stop using comma from command substitution in brace expansion 2024-04-26 18:15:47 +02:00
broken-config.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
buildinfo.fish Add status buildinfo (#10896) 2024-12-29 13:37:28 +01:00
builtinbuiltin.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
caller-exit.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
caller-observer.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
cd.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
check-all-fish-files.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
check-completions.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
check-translations.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
cmdsub-limit.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
cmdsub.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
colon-delimited-var.fish Clean up how PATH and CDPATH munging occurs 2019-11-02 16:48:08 -07:00
command-1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
command-2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
command-not-found.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
command-vars-persist.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
commandline.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
complete-group-order.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
complete.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
complete_directories.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
completion-autoload-tombstone.fish Make "complete -e" prevent completion autoloading 2024-08-24 08:30:52 +02:00
contains_opt.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
count.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
create-base-directories.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
deep-cmdsub.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
default-setup-path.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
directory-redirect.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
disown-parent.fish tests: Specifically #require fish_test_helper when needed 2025-01-01 16:45:43 +01:00
empty.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
env.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
eval.fish Tests: Don't cd to the tests directory! 2025-01-01 16:45:43 +01:00
exec.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
exit-status-with-closing-stderr.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
expansion.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
fds.fish tests: Specifically #require fish_test_helper when needed 2025-01-01 16:45:43 +01:00
features-ampersand-nobg-in-token1.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
features-nocaret1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-nocaret2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-nocaret3.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-nocaret4.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-percent-self1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-percent-self2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-qmark1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-qmark2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-string-backslashes-off.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-string-backslashes.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
fish_add_path.fish fish_add_path: Be more informative in verbose mode 2024-06-06 16:47:39 +02:00
fish_exit.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
fish_user_paths.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
for.fish Push and pop for-block every run through the loop 2024-05-25 13:20:05 +02:00
function-definition.fish functions: Fix --argument-names display 2024-05-06 17:00:45 +02:00
function.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
functions.fish Tests: Don't cd to the tests directory! 2025-01-01 16:45:43 +01:00
git.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
glob.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
history.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
indent.fish fish_indent: Read from stdin, take two 2025-01-12 16:17:49 +01:00
init-command-2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-command-mix-ordering.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-command-mix.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-command.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-unreadable-cwd.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
invocation.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
job-control-noninteractive.fish tests: Specifically #require fish_test_helper when needed 2025-01-01 16:45:43 +01:00
job-control-not-a-tty.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
job-ids.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
jobs-are-escaped.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
jobs.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
line-continuation.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
line-number.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
locale-numeric.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
locale.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
loops.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
math.fish math: Nicer error for non-ascii-lowercase identifiers 2024-09-18 22:27:00 +02:00
no-config.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
no-execute.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
noshebang.fish tests: Fix noshebang test 2024-04-25 21:52:56 +02:00
not.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
nuls.fish Support quoted escaping also when ' or \ is present 2024-04-13 15:33:05 +02:00
path.fish Add path basename -E tests 2024-05-26 22:06:11 -05:00
pipeline-pgroup.fish tests: Specifically #require fish_test_helper when needed 2025-01-01 16:45:43 +01:00
pipestatus.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
print-help.fish tests: Remove skipped tests hack for Cmake < 3.9.0 2024-06-11 16:55:11 +02:00
printf.fish Fix crash when sprintf width argument overflows u64 2024-11-09 08:16:08 +01:00
prompt.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
psub.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
random.fish builtin random: Be less strict about arguments 2024-12-02 19:06:14 +01:00
rc-returned.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
read.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
realpath.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
redirect.fish Add <? input redirection 2024-04-21 14:35:13 +02:00
regex-import.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
return.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
scoping.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
self-signal-usr1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
set.fish Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
setenv.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
sigint.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
sigint2.fish tests: Specifically #require fish_test_helper when needed 2025-01-01 16:45:43 +01:00
signal.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
slices.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
source.fish Allow builtin source to read from non-regular files 2024-10-13 10:44:38 +02:00
stack-overflow.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
status-command.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
status-value.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
status.fish Feature flag to prevent executing off buffered keys 2025-01-06 06:24:13 +01:00
string-advanced.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
string.fish Tests: Don't cd to the tests directory! 2025-01-01 16:45:43 +01:00
switch.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
symlinks-not-overwritten.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
syntax-error-location.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
test-posix.fish Deprecate builtin test's one- and zero-argument modes (#10365) 2024-04-21 14:25:54 +02:00
test.fish Deprecate builtin test's one- and zero-argument modes (#10365) 2024-04-21 14:25:54 +02:00
threads.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
time.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
tmux-abbr.fish Fix regression spuriously expanding abbr with cursor outside token 2024-05-03 08:39:05 +02:00
tmux-autosuggestion.fish Restore autosuggestion after corrected typo 2025-01-11 18:58:49 +01:00
tmux-bind.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
tmux-bind2.fish bind: Remove "c-" and "a-" shortcut notation 2024-11-13 17:48:15 +01:00
tmux-commandline.fish Fix regression causing crash in "commandline -j" 2025-01-12 19:55:17 +01:00
tmux-complete.fish ctrl-l to scroll content instead of erasing screen 2024-12-30 10:50:38 +01:00
tmux-complete2.fish Fix replacing completions spuriously quoting ~ 2024-12-08 15:27:08 +01:00
tmux-history-search.fish Rename the readline function for deleting active history item 2025-01-11 18:58:49 +01:00
tmux-job.fish tmux-job: Add more sleeps 2025-01-08 19:10:38 +01:00
tmux-multiline-prompt.fish Fix tmux-multiline-prompt check 2024-12-27 21:02:38 +01:00
tmux-prompt.fish Re-enable tmux-prompt test under FreeBSD 2024-11-14 13:44:49 -06:00
tmux-scrollback.fish Fix assertion error in when scrollback-push is enqueued from script 2024-12-30 14:20:05 +01:00
tmux-signal.fish Send repaint requests through the input queue again 2024-04-19 12:05:27 +02:00
tmux-transient.fish Prevent out-of-order execution following repaint 2024-05-13 10:44:12 +02:00
trace.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
trap.fish tests: Specifically #require fish_test_helper when needed 2025-01-01 16:45:43 +01:00
trap_print.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
type.fish checks/type: Relax sh path even more 2024-12-29 22:11:34 +01:00
ulimit.fish Tests: Don't cd to the tests directory! 2025-01-01 16:45:43 +01:00
umask.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
variable-assignment.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
vars_as_commands.fish Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
version.fish tests/version: Update for "-beta" 2024-12-17 16:44:34 +01:00
wait.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
wildcard.fish Tests: Don't cd to the tests directory! 2025-01-01 16:45:43 +01:00
wraps.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
zero_based_array.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00