fix(tst): resolve the temp directory in modulepath_test.sh (macOS)

Case 5 of the module-resolution suite failed on macOS only, because /var
is a symlink to /private/var there: `mktemp -d` returns an unresolved
path while Python's os.getcwd() reports the resolved one, so the test
compared two spellings of the same directory.  Resolving the temp
directory once at creation with `pwd -P` makes every path in the suite
consistent.

(from dev ca9eaa2c867a)
This commit is contained in:
2026-07-28 23:53:35 +02:00
parent cacff229a1
commit 2cd336b926
2 changed files with 8 additions and 2 deletions

View File

@@ -31,7 +31,13 @@ green=$'\033[32m'
bold=$'\033[1m'
reset=$'\033[0m'
T="$(mktemp -d)"
# Resolve the temporary directory to its physical path. On macOS /var is a
# symlink to /private/var, so `mktemp -d` hands back an unresolved
# /var/folders/... while Python's os.getcwd() reports the resolved
# /private/var/folders/... — case 5 would then compare two spellings of the
# same directory and fail on the Mac only. `pwd -P` is POSIX; macOS has no
# GNU realpath by default.
T="$(cd "$(mktemp -d)" && pwd -P)"
trap 'rm -rf "$T"' EXIT
mkdir -p "$T/seta" "$T/setb" "$T/elsewhere"