fish-shell/tests
Fabian Homborg 2087a3ca63 Let visible length work with CR and LF
Because we are, ultimately, interested in how many cells a string
occupies, we *have* to handle carriage return (`\r`) and line
feed (`\n`).

A carriage return sets the current tally to 0, and only the longest
tally is kept. The idea here is that the last position is the same as
the last position of the longest string. So:

abcdef\r123

ends up looking like

123def

which is the same width as abcdef, 6.

A line feed meanwhile means we flush the current tally and start a new
one. Every line is printed separately, even if it's given as one.

That's because, well, counting the width over multiple lines
doesn't *help*.

As a sidenote: This is necessarily imperfect, because, while we may
know the width of the terminal ($COLUMNS), we don't know the current
cursor position. So we can only give the width, and the user can then
figure something out on their own.

But for the common case of figuring out how wide the prompt is, this
should do.
2021-08-04 21:09:47 +02:00
..
checks Let visible length work with CR and LF 2021-08-04 21:09:47 +02:00
pexpects Update commandline state before completion 2021-07-27 19:03:35 +02:00
test_functions Resurrect one last function 2020-03-17 21:58:49 +01:00
.gitignore tweak gitignore rules for *tests* directory 2017-02-20 20:29:43 -08:00
history_sample_bash Support $(cmd) command substitution as alternative to (cmd) 2021-07-13 21:33:42 +02:00
history_sample_corrupt1 Improve history robustness against corrupt files 2014-07-29 14:42:03 -07:00
history_sample_fish_1_x Enforce that history items must end with trailing newlines 2021-05-10 14:23:07 -07:00
history_sample_fish_2_0 Enforce that history items must end with trailing newlines 2021-05-10 14:23:07 -07:00
interactive.config Remove some unused functions from the test harness 2020-11-15 09:17:23 +01:00
interactive.fish tests/bind: Skip on Github macOS 2021-05-23 19:46:04 +02:00
test.fish Cleanup test setup a bit 2020-11-15 09:17:23 +01:00
test_util.fish tests: Remove unused colordiff function 2021-01-01 14:18:17 +01:00