Skip to content

Commit d1d77cd

Browse files
committed
Use test.Helper in helper funcs
1 parent f007012 commit d1d77cd

File tree

1 file changed

+4
-0
lines changed
  • staging/src/k8s.io/apimachinery/pkg/api/validate

1 file changed

+4
-0
lines changed

staging/src/k8s.io/apimachinery/pkg/api/validate/each_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func TestEachSliceVal(t *testing.T) {
5959
}
6060

6161
func testEachSliceVal[T any](t *testing.T, name string, input []T) {
62+
t.Helper()
6263
var zero T
6364
t.Run(fmt.Sprintf("%s(%T)", name, zero), func(t *testing.T) {
6465
calls := 0
@@ -77,6 +78,7 @@ func testEachSliceVal[T any](t *testing.T, name string, input []T) {
7778
}
7879

7980
func testEachSliceValUpdate[T any](t *testing.T, name string, input []T) {
81+
t.Helper()
8082
var zero T
8183
t.Run(fmt.Sprintf("%s(%T)", name, zero), func(t *testing.T) {
8284
calls := 0
@@ -116,6 +118,7 @@ func TestEachMapVal(t *testing.T) {
116118
}
117119

118120
func testEachMapVal[T any](t *testing.T, name string, input map[string]T) {
121+
t.Helper()
119122
var zero T
120123
t.Run(fmt.Sprintf("%s(%T)", name, zero), func(t *testing.T) {
121124
calls := 0
@@ -141,6 +144,7 @@ func TestEachMapKey(t *testing.T) {
141144
}
142145

143146
func testEachMapKey[K ~string, V any](t *testing.T, name string, input map[K]V) {
147+
t.Helper()
144148
var zero K
145149
t.Run(fmt.Sprintf("%s(%T)", name, zero), func(t *testing.T) {
146150
calls := 0

0 commit comments

Comments
 (0)