mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
make unit tests more hermetic regarding env vars
Specifically, the `TERM` and `ITERM_PROFILE` env vars. If we don't set them to known values the unit tests can fail in unexpected ways. Fixes #3395
This commit is contained in:
parent
2c8bc05826
commit
93bea5b321
2 changed files with 12 additions and 0 deletions
|
@ -10,6 +10,12 @@ set TESTS_TO_RETRY bind.expect
|
|||
# Change to directory containing this script
|
||||
cd (dirname (status -f))
|
||||
|
||||
# These env vars should not be inherited from the user environment because they can affect the
|
||||
# behavior of the tests. So either remove them or set them to a known value.
|
||||
# See also tests/test.fish.
|
||||
set TERM xterm
|
||||
set -e ITERM_PROFILE
|
||||
|
||||
# Test files specified on commandline, or all *.expect files
|
||||
if set -q argv[1]
|
||||
set files_to_test $argv.expect
|
||||
|
|
|
@ -14,6 +14,12 @@ else
|
|||
set files_to_test *.in
|
||||
end
|
||||
|
||||
# These env vars should not be inherited from the user environment because they can affect the
|
||||
# behavior of the tests. So either remove them or set them to a known value.
|
||||
# See also tests/interactive.fish.
|
||||
set TERM xterm
|
||||
set -e ITERM_PROFILE
|
||||
|
||||
source test_util.fish (status -f) $argv; or exit
|
||||
|
||||
say -o cyan "Testing high level script functionality"
|
||||
|
|
Loading…
Reference in a new issue