Skip to content

Commit

Permalink
path/filepath: pass TestToNorm even if VolumeName(tmpdir) != VolumeNa…
Browse files Browse the repository at this point in the history
…me(pwd) on windows

Fixes #17504

Change-Id: Ic83578cf2019e5d8778e4b324f04931eb802f603
Reviewed-on: https://go-review.googlesource.com/31544
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
  • Loading branch information
hirochachacha authored and alexbrainman committed Oct 23, 2016
1 parent b7477f3 commit 0e7f970
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/path/filepath/path_windows_test.go
Expand Up @@ -337,10 +337,10 @@ func TestToNorm(t *testing.T) {
{`{{tmp}}\test`, `{{tmpvol}}FOO\BAR`, `{{tmpvol}}foo\bar`},

// test relative paths begin with '\'
{".", `{{tmpnovol}}\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
{".", `{{tmpnovol}}\.\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
{".", `{{tmpnovol}}\test\..\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
{".", `{{tmpnovol}}\TEST\FOO\BAR`, `{{tmpnovol}}\test\foo\bar`},
{"{{tmp}}", `{{tmpnovol}}\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
{"{{tmp}}", `{{tmpnovol}}\.\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
{"{{tmp}}", `{{tmpnovol}}\test\..\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
{"{{tmp}}", `{{tmpnovol}}\TEST\FOO\BAR`, `{{tmpnovol}}\test\foo\bar`},

// test relative paths begin without '\'
{`{{tmp}}\test`, ".", `.`},
Expand All @@ -355,7 +355,6 @@ func TestToNorm(t *testing.T) {
if err != nil {
t.Fatal(err)
}

defer func() {
err := os.Chdir(cwd)
if err != nil {
Expand Down

0 comments on commit 0e7f970

Please sign in to comment.