From e33929705bc08181006947ca424fb77f043dfeca Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Thu, 16 Apr 2020 23:25:57 -0400 Subject: [PATCH] internal/lsp/regtest: enable test for golang/go#37195 I believe that other changes in gopls/v0.4.0 also fixed the issue that this regression test was written for. Re-enable it, and change it to assert that diagnostics are cleared. Fixes golang/go#37195 Change-Id: I4538186ad288d9c6f70cc450f948b62f3868941f Reviewed-on: https://go-review.googlesource.com/c/tools/+/228723 Run-TryBot: Rebecca Stambler TryBot-Result: Gobot Gobot Reviewed-by: Robert Findley --- internal/lsp/regtest/diagnostics_test.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/lsp/regtest/diagnostics_test.go b/internal/lsp/regtest/diagnostics_test.go index 72447f5427..dfeb761b18 100644 --- a/internal/lsp/regtest/diagnostics_test.go +++ b/internal/lsp/regtest/diagnostics_test.go @@ -51,13 +51,21 @@ go 1.12 ` func TestMissingImportDiagsClearOnFirstFile(t *testing.T) { - t.Skip("skipping due to golang.org/issues/37195") t.Parallel() runner.Run(t, onlyMod, func(t *testing.T, env *Env) { - env.CreateBuffer("main.go", "package main\n\nfunc m() {\nlog.Println()\n}") + env.CreateBuffer("main.go", `package main + +func m() { + log.Println() +} +`) + env.Await( + env.DiagnosticAtRegexp("main.go", "log"), + ) env.SaveBuffer("main.go") - // TODO: this shouldn't actually happen - env.Await(env.DiagnosticAtRegexp("main.go", "Println")) + env.Await( + EmptyDiagnostics("main.go"), + ) }) }