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 <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Bryan C. Mills 2022-01-06 14:32:14 -05:00 committed by Bryan Mills
parent 4754748303
commit a1300ed2ba
1 changed files with 1 additions and 3 deletions

View File

@ -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),