summaryrefslogtreecommitdiff
path: root/src/cmd/go/script_test.go
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2019-10-23 13:47:36 -0400
committerJay Conrod <jayconrod@google.com>2019-10-23 18:41:38 +0000
commit7833302a6258a65bc17526b54347601df5ff1c5e (patch)
treea06c0b5f59351d7eb8ee2e0bd14f472e6da5461e /src/cmd/go/script_test.go
parent67fb5530f07ae77a5e2fe6b8f5dcf3305e117460 (diff)
downloadgo-git-7833302a6258a65bc17526b54347601df5ff1c5e.tar.gz
cmd/go: ignore '@' when cleaning local and absolute file path args
Since CL 194600, search.CleanPaths preserves characters after '@' in each argument. This was done so that paths could be cleaned while version queries were preserved. However, local and absolute file paths may contain '@' characters. With this change, '@' is treated as a normal character by search.CleanPaths in local and absolute paths. Fixes #35115 Change-Id: Ia7d37e0a2737442d4f1796cc2fc3a59237a8ddfe Reviewed-on: https://go-review.googlesource.com/c/go/+/202761 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/script_test.go')
-rw-r--r--src/cmd/go/script_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
index 31e527fd40..362a10fa86 100644
--- a/src/cmd/go/script_test.go
+++ b/src/cmd/go/script_test.go
@@ -117,6 +117,7 @@ func (ts *testScript) setup() {
"GOSUMDB=" + testSumDBVerifierKey,
"GONOPROXY=",
"GONOSUMDB=",
+ "PWD=" + ts.cd,
tempEnvName() + "=" + filepath.Join(ts.workdir, "tmp"),
"devnull=" + os.DevNull,
"goversion=" + goVersion(ts),
@@ -414,6 +415,7 @@ func (ts *testScript) cmdCd(neg bool, args []string) {
ts.fatalf("%s is not a directory", dir)
}
ts.cd = dir
+ ts.envMap["PWD"] = dir
fmt.Fprintf(&ts.log, "%s\n", ts.cd)
}