cmd/vet: make TestTags pass on windows
Update golang/go#11811 Change-Id: I3d875acf58a015fa4cae16473a118ac8196b9b44 Reviewed-on: https://go-review.googlesource.com/12789 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
0f0e72bcc3
commit
7ba2a8c9a9
|
@ -15,7 +15,7 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
dataDir = "testdata"
|
dataDir = "testdata"
|
||||||
binary = "testvet"
|
binary = "testvet.exe"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Run this shell script, but do it in Go so it can be run by "go test".
|
// Run this shell script, but do it in Go so it can be run by "go test".
|
||||||
|
@ -93,10 +93,10 @@ func TestTags(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
// file1 has testtag and file2 has !testtag.
|
// file1 has testtag and file2 has !testtag.
|
||||||
if !bytes.Contains(output, []byte("tagtest/file1.go")) {
|
if !bytes.Contains(output, []byte(filepath.Join("tagtest", "file1.go"))) {
|
||||||
t.Error("file1 was excluded, should be included")
|
t.Error("file1 was excluded, should be included")
|
||||||
}
|
}
|
||||||
if bytes.Contains(output, []byte("tagtest/file2.go")) {
|
if bytes.Contains(output, []byte(filepath.Join("tagtest", "file2.go"))) {
|
||||||
t.Error("file2 was included, should be excluded")
|
t.Error("file2 was included, should be excluded")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue