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:
@@ -41,7 +41,7 @@ are regenerated on each release — patches cannot be merged directly.
|
|||||||
Report problems (or send patches) to the author; accepted changes are
|
Report problems (or send patches) to the author; accepted changes are
|
||||||
applied to the development tree and appear in a following snapshot.
|
applied to the development tree and appear in a following snapshot.
|
||||||
|
|
||||||
This snapshot was assembled from development commit `6024f49c2859`.
|
This snapshot was assembled from development commit `ca9eaa2c867a`.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,13 @@ green=$'\033[32m'
|
|||||||
bold=$'\033[1m'
|
bold=$'\033[1m'
|
||||||
reset=$'\033[0m'
|
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
|
trap 'rm -rf "$T"' EXIT
|
||||||
|
|
||||||
mkdir -p "$T/seta" "$T/setb" "$T/elsewhere"
|
mkdir -p "$T/seta" "$T/setb" "$T/elsewhere"
|
||||||
|
|||||||
Reference in New Issue
Block a user