mirror of https://github.com/golang/go.git
add test, use filepath.Separator
This commit is contained in:
parent
3c3f1cf6c4
commit
1493f38baf
|
|
@ -5921,3 +5921,11 @@ echo $* >>`+tg.path("pkg-config.out"))
|
|||
t.Errorf("got %q want %q", out, want)
|
||||
}
|
||||
}
|
||||
|
||||
// Issue 23982
|
||||
func TestFilepathUnderCwdFormat(t *testing.T) {
|
||||
tg := testgo(t)
|
||||
defer tg.cleanup()
|
||||
tg.run("test", "-x", "-cover", "log")
|
||||
tg.grepStderrNot(`\.log\.cover\.go`, "-x output should contain correctly formatted filepath under cwd")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1365,8 +1365,8 @@ func (b *Builder) fmtcmd(dir string, format string, args ...interface{}) string
|
|||
cmd := fmt.Sprintf(format, args...)
|
||||
if dir != "" && dir != "/" {
|
||||
dot := " ."
|
||||
if dir[len(dir)-1] == '/' {
|
||||
dot += "/"
|
||||
if dir[len(dir)-1] == filepath.Separator {
|
||||
dot += string(filepath.Separator)
|
||||
}
|
||||
cmd = strings.Replace(" "+cmd, " "+dir, dot, -1)[1:]
|
||||
if b.scriptDir != dir {
|
||||
|
|
|
|||
Loading…
Reference in New Issue