From f2a9326f67849f47d9f19a926b05c83be925bd76 Mon Sep 17 00:00:00 2001 From: Brad Garcia Date: Tue, 26 Nov 2013 13:28:43 -0500 Subject: [PATCH] godoc: fix cmdline_test under Windows. Make sure the absolute path testcase starts with a volume name for windows platforms. R=bradfitz CC=alex.brainman, golang-dev https://golang.org/cl/32800043 --- godoc/cmdline_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/godoc/cmdline_test.go b/godoc/cmdline_test.go index 7f71a385..303aeafc 100644 --- a/godoc/cmdline_test.go +++ b/godoc/cmdline_test.go @@ -8,6 +8,7 @@ import ( "path/filepath" "reflect" "regexp" + "runtime" "testing" "text/template" @@ -68,6 +69,11 @@ func TestPaths(t *testing.T) { } fs := make(vfs.NameSpace) + absPath := "/foo/fmt" + if runtime.GOOS == "windows" { + absPath = `c:\foo\fmt` + } + for _, tc := range []struct { desc string path string @@ -76,7 +82,7 @@ func TestPaths(t *testing.T) { }{ { "Absolute path", - "/foo/fmt", + absPath, "/target", "/target", },