mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 18:22:45 +08:00
Make the cd check more robust on macOS
macOS `mktemp -d` likes to return symlinks. Guard against that possibility. That allows the test to succeed when run directly, instead of through the build target.
This commit is contained in:
parent
e74befd3ab
commit
788f359cda
|
@ -23,10 +23,9 @@ rm -rf $tmp
|
|||
cd $oldpwd
|
||||
|
||||
# Create a test directory to store our stuff.
|
||||
set -l base /tmp/cdcomp_test
|
||||
rm -Rf $base
|
||||
mkdir -p $base
|
||||
set real (mktemp -d)
|
||||
# macOS likes to return symlinks from (mktemp -d), make sure it does not.
|
||||
set -l base (realpath (mktemp -d))
|
||||
set real (realpath (mktemp -d))
|
||||
set link $base/link
|
||||
ln -s $real $link
|
||||
cd $link
|
||||
|
@ -83,7 +82,7 @@ ln -s $base/realhome $base/linkhome
|
|||
cd $base/linkhome
|
||||
set -l real_getcwd (pwd -P)
|
||||
env HOME=$base/linkhome $fish -c 'echo PWD is $PWD'
|
||||
#CHECK: PWD is /tmp/cdcomp_test/linkhome
|
||||
#CHECK: PWD is {{.*}}/linkhome
|
||||
|
||||
|
||||
# Do not inherit a virtual PWD that fails to resolve to getcwd (#5647)
|
||||
|
|
Loading…
Reference in New Issue
Block a user