From a1300ed2bacbcd5fa816eae9ac5a1ab566da4798 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 6 Jan 2022 14:32:14 -0500 Subject: [PATCH] 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 Run-TryBot: Bryan Mills gopls-CI: kokoro Reviewed-by: Robert Findley TryBot-Result: Gopher Robot --- internal/lsp/tests/tests.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/lsp/tests/tests.go b/internal/lsp/tests/tests.go index 13da55994c..45d3ccd052 100644 --- a/internal/lsp/tests/tests.go +++ b/internal/lsp/tests/tests.go @@ -270,20 +270,18 @@ func RunTests(t *testing.T, dataDir string, includeMultiModule bool, f func(*tes } for _, mode := range modes { t.Run(mode, func(t *testing.T) { - t.Helper() if mode == "MultiModule" { // Some bug in 1.12 breaks reading markers, and it's not worth figuring out. testenv.NeedsGo1Point(t, 13) } datum := load(t, mode, dataDir) + t.Helper() f(t, datum) }) } } func load(t testing.TB, mode string, dir string) *Data { - t.Helper() - datum := &Data{ CallHierarchy: make(CallHierarchy), CodeLens: make(CodeLens),