mirror of https://github.com/golang/go.git
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:
parent
4754748303
commit
a1300ed2ba
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue