1 [short] skip
2 [!race] skip
3
4 go test -v -race
5 stdout 'testing_test.go:26: directCall'
6 stdout 'testing_test.go:27: interfaceTBCall'
7 stdout 'testing_test.go:28: interfaceCall'
8
9 -- go.mod --
10 module 26995-TBHelper-line-number
11
12 go 1.21
13 -- testing_test.go --
14 package testing_test
15
16 import "testing"
17
18 type TestingT interface {
19 Helper()
20 Log(args ...interface{})
21 }
22
23 func directCall(t *testing.T) {
24 t.Helper()
25 t.Log("directCall")
26 }
27
28 func interfaceTBCall(t testing.TB) {
29 t.Helper()
30 t.Log("interfaceTBCall")
31 }
32
33 func interfaceCall(t TestingT) {
34 t.Helper()
35 t.Log("interfaceCall")
36 }
37
38 func TestTesting(t *testing.T) {
39 directCall(t)
40 interfaceTBCall(t)
41 interfaceCall(t)
42 }
43
View as plain text