Use physical $PWD

Yeah, the macOS tests fail because it's started in /private/var... with a
$PWD of /var.... So resolve canonicalizes the path, which makes it no
longer match $PWD.

Simply use pwd -P
This commit is contained in:
Fabian Homborg 2022-02-02 20:46:32 +01:00
parent 23a5e53247
commit 55c34cbb7c

View file

@ -113,11 +113,11 @@ path resolve bin//sh | string match -r -- 'bin/bash$'
# `path resolve` with nonexistent paths
set -l path (path resolve foo/bar)
string match -rq "^"(string escape --style=regex -- $PWD)'/' -- $path
string match -rq "^"(pwd -P | string escape --style=regex)'/' -- $path
and echo It matches pwd!
or echo pwd is \'$PWD\' resolved path is \'$path\'
# CHECK: It matches pwd!
string replace -r "^"(string escape --style=regex -- $PWD)'/' "" -- $path
string replace -r "^"(pwd -P | string escape --style=regex)'/' "" -- $path
# CHECK: foo/bar
path resolve /banana//terracota/terracota/booooo/../pie