tests/functional/shell.sh: account for IN_NIX3_SHELL

This commit is contained in:
Max Headroom 2024-07-23 14:55:44 +02:00
parent 4a9c72b389
commit e2d390dd3f

View file

@ -33,10 +33,12 @@ nix shell -f shell-hello.nix hello -c env > $TEST_ROOT/actual-env
# - PATH is modified by nix shell
# - _ is set by bash and is expectedf to differ because it contains the original command
# - __CF_USER_TEXT_ENCODING is set by macOS and is beyond our control
# - IN_NIX3_SHELL is set by nix shell
sed -i \
-e 's/PATH=.*/PATH=.../' \
-e 's/_=.*/_=.../' \
-e '/^__CF_USER_TEXT_ENCODING=.*$/d' \
-e '/^IN_NIX3_SHELL=1$/d' \
$TEST_ROOT/expected-env $TEST_ROOT/actual-env
sort $TEST_ROOT/expected-env > $TEST_ROOT/expected-env.sorted
sort $TEST_ROOT/actual-env > $TEST_ROOT/actual-env.sorted