fish-shell/tests
Ilya Grigoriev 762f3aa0ce
Rewrite the real file if history file is a symlink (#7754)
* Rewrite the real file if history file is a symlink

When the history file is a symbolic link, `fish` used to overwrite
the link with a real file whenever it saved history. This makes
it follow the symlink and overwrite the real file instead.

The same issue was fixed for the `fish_variables` file in 622f2868e
from https://github.com/fish-shell/fish-shell/pull/7728.
This makes `fish_history` behave in the same way. The implementation
is nearly identical.

Since the tests for the two issues are so similar, I combined them
together and slightly expanded the older test.

This also addresses https://github.com/fish-shell/fish-shell/issues/7553.

* Add user-facing error when history renaming fails

Currently, when history file renaming fails, no message is shown to the
user. This happens, for instance, if the history file is a symlink
pointing to another filesystem.

This copies code (with a bit of variation, after reviewer comments) from

589eb34571/src/env_universal_common.cpp (L486-L491)

into `history.cpp`, so that a message is shown to the user.

* fixup! Rewrite the real file if history file is a symlink
2021-03-08 17:46:17 +01:00
..
checks Rewrite the real file if history file is a symlink (#7754) 2021-03-08 17:46:17 +01:00
pexpects Reset the readline loop state when setting the buffer 2021-02-25 16:19:28 +01: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 Stop expanding globs in command position when performing error checking 2020-12-22 12:38:51 -08:00
history_sample_corrupt1 Improve history robustness against corrupt files 2014-07-29 14:42:03 -07:00
history_sample_fish_1_x Support for importing fish 1.x's history and format, and also bash 2012-06-15 16:24:05 -07:00
history_sample_fish_2_0 Support for importing fish 1.x's history and format, and also bash 2012-06-15 16:24:05 -07:00
interactive.config Remove some unused functions from the test harness 2020-11-15 09:17:23 +01:00
interactive.fish Allow to run individual interactive tests by setting FISH_PEXPECT_FILES 2021-01-07 17:09:05 +01: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