Fixes #26995
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-race,gotip-linux-386-longtest,gotip-windows-amd64-longtest
Change-Id: If3b68002d205fe985a692b69f5d7e0d2f20a7bd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/540016
TryBot-Bypass: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
--- /dev/null
+[short] skip
+[!race] skip
+
+go test -v -race
+stdout 'testing_test.go:26: directCall'
+stdout 'testing_test.go:27: interfaceTBCall'
+stdout 'testing_test.go:28: interfaceCall'
+
+-- go.mod --
+module 26995-TBHelper-line-number
+
+go 1.21
+-- testing_test.go --
+package testing_test
+
+import "testing"
+
+type TestingT interface {
+ Helper()
+ Log(args ...interface{})
+}
+
+func directCall(t *testing.T) {
+ t.Helper()
+ t.Log("directCall")
+}
+
+func interfaceTBCall(t testing.TB) {
+ t.Helper()
+ t.Log("interfaceTBCall")
+}
+
+func interfaceCall(t TestingT) {
+ t.Helper()
+ t.Log("interfaceCall")
+}
+
+func TestTesting(t *testing.T) {
+ directCall(t)
+ interfaceTBCall(t)
+ interfaceCall(t)
+}