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
This commit is contained in:
Brad Garcia 2013-11-26 13:28:43 -05:00
parent bbf45e5e0c
commit f2a9326f67
1 changed files with 7 additions and 1 deletions

View File

@ -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",
},