Skip to content

Commit a1300ed

Browse files
author
Bryan C. Mills
committed
internal/lsp/tests: remove unnecessary uses of t.Helper
The purpose of t.Helper is to attribute test failures to the caller's file and line number. However, in lsp.TestLSP (and in tests.RunTests) the reason for a given failure tends to have little to no relationship to the caller code, so it is more useful to attribute failures to the specific part of the setup that fails. For golang/go#50477 Change-Id: I7c37070d036efb20f68764cfb82ce2aab1ff933c Reviewed-on: https://go-review.googlesource.com/c/tools/+/375877 Trust: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> gopls-CI: kokoro <[email protected]> Reviewed-by: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 4754748 commit a1300ed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

internal/lsp/tests/tests.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -270,20 +270,18 @@ func RunTests(t *testing.T, dataDir string, includeMultiModule bool, f func(*tes
270270
}
271271
for _, mode := range modes {
272272
t.Run(mode, func(t *testing.T) {
273-
t.Helper()
274273
if mode == "MultiModule" {
275274
// Some bug in 1.12 breaks reading markers, and it's not worth figuring out.
276275
testenv.NeedsGo1Point(t, 13)
277276
}
278277
datum := load(t, mode, dataDir)
278+
t.Helper()
279279
f(t, datum)
280280
})
281281
}
282282
}
283283

284284
func load(t testing.TB, mode string, dir string) *Data {
285-
t.Helper()
286-
287285
datum := &Data{
288286
CallHierarchy: make(CallHierarchy),
289287
CodeLens: make(CodeLens),

0 commit comments

Comments
 (0)