Skip to content

Commit 0e7f970

Browse files
hirochachachaalexbrainman
authored andcommitted
path/filepath: pass TestToNorm even if VolumeName(tmpdir) != VolumeName(pwd) on windows
Fixes #17504 Change-Id: Ic83578cf2019e5d8778e4b324f04931eb802f603 Reviewed-on: https://go-review.googlesource.com/31544 TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alex Brainman <[email protected]>
1 parent b7477f3 commit 0e7f970

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/path/filepath/path_windows_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ func TestToNorm(t *testing.T) {
337337
{`{{tmp}}\test`, `{{tmpvol}}FOO\BAR`, `{{tmpvol}}foo\bar`},
338338

339339
// test relative paths begin with '\'
340-
{".", `{{tmpnovol}}\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
341-
{".", `{{tmpnovol}}\.\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
342-
{".", `{{tmpnovol}}\test\..\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
343-
{".", `{{tmpnovol}}\TEST\FOO\BAR`, `{{tmpnovol}}\test\foo\bar`},
340+
{"{{tmp}}", `{{tmpnovol}}\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
341+
{"{{tmp}}", `{{tmpnovol}}\.\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
342+
{"{{tmp}}", `{{tmpnovol}}\test\..\test\foo\bar`, `{{tmpnovol}}\test\foo\bar`},
343+
{"{{tmp}}", `{{tmpnovol}}\TEST\FOO\BAR`, `{{tmpnovol}}\test\foo\bar`},
344344

345345
// test relative paths begin without '\'
346346
{`{{tmp}}\test`, ".", `.`},
@@ -355,7 +355,6 @@ func TestToNorm(t *testing.T) {
355355
if err != nil {
356356
t.Fatal(err)
357357
}
358-
359358
defer func() {
360359
err := os.Chdir(cwd)
361360
if err != nil {

0 commit comments

Comments
 (0)