Fixes #45477
Change-Id: I2f1ed281515ec40d31fd07ce9f4901777691bfa7
GitHub-Last-Rev:
7894d9400c95b8d84efe88f401fa75c3dd01921a
GitHub-Pull-Request: golang/go#49673
Reviewed-on: https://go-review.googlesource.com/c/go/+/365534
Trust: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
--- /dev/null
+[short] skip # links and runs a test binary
+
+go test -v .
+
+-- go.mod --
+module example.com/pkg_test
+
+-- pkg.go --
+package pkg_test
+
+-- pkg_test.go --
+package pkg_test
isTest := strings.HasSuffix(name, "_test.go")
isXTest := false
- if isTest && strings.HasSuffix(pkg, "_test") {
+ if isTest && strings.HasSuffix(pkg, "_test") && p.Name != pkg {
isXTest = true
pkg = pkg[:len(pkg)-len("_test")]
}