diff options
| author | Christopher Nelson <nadiasvertex@gmail.com> | 2016-03-15 09:14:22 -0400 |
|---|---|---|
| committer | Alex Brainman <alex.brainman@gmail.com> | 2016-03-18 01:12:06 +0000 |
| commit | e4d489a85fd1825ddcc6c1ffda52fb9e75ad01b4 (patch) | |
| tree | ec2d25339d23c0d80e47a5ed21ac91cbd1b7975e /src | |
| parent | 09a9ce60c7014ddff97690bf023ac5b2bfc142c7 (diff) | |
| download | go-e4d489a85fd1825ddcc6c1ffda52fb9e75ad01b4.tar.xz | |
cmd/go: fix TestShadowingLogic fails when GOROOT path has spaces
Improve the test by also translating " " to "_".
Fixes #14671.
Change-Id: Ie5997934b93c7663d7b8432244fad47bb5d3ffbe
Reviewed-on: https://go-review.googlesource.com/20714
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/go_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 5526aec8f9..e663907e26 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1870,7 +1870,9 @@ func TestShadowingLogic(t *testing.T) { } // The output will have makeImportValid applies, but we only // bother to deal with characters we might reasonably see. - pwdForwardSlash = strings.Replace(pwdForwardSlash, ":", "_", -1) + for _, r := range " :" { + pwdForwardSlash = strings.Replace(pwdForwardSlash, string(r), "_", -1) + } want := "(_" + pwdForwardSlash + "/testdata/shadow/root1/src/math) (" + filepath.Join(runtime.GOROOT(), "src", "math") + ")" if strings.TrimSpace(tg.getStdout()) != want { t.Error("shadowed math is not shadowed; looking for", want) |
