fish-shell/tests
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
..
checks Fix regression causing crash in "commandline -j" 2025-01-12 19:55:17 +01:00
pexpects Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00
test_functions Fix tmux-multiline-prompt test with EDITOR=vim 2024-10-27 05:03:30 +01:00
.gitignore
fish_test_helper.c Compile fish_test_helper in the test driver 2025-01-01 16:45:43 +01:00
history_sample_bash Support $(cmd) command substitution as alternative to (cmd) 2021-07-13 21:33:42 +02:00
history_sample_corrupt1
history_sample_fish_1_x
history_sample_fish_2_0
interactive.config
littlecheck.py Update littlecheck to fix spurious "not found" error on exit 127 2025-01-06 06:40:43 +01:00
pexpect_helper.py Make tests usable with path with spaces 2025-01-01 16:45:43 +01:00
test_driver.py Rewrite test driver in python (#11028) 2025-01-11 21:13:19 +01:00