diff --git a/go/packages/packagestest/export.go b/go/packages/packagestest/export.go index ad38ebf1..14424951 100644 --- a/go/packages/packagestest/export.go +++ b/go/packages/packagestest/export.go @@ -136,6 +136,7 @@ func Export(t testing.TB, exporter Exporter, modules []Module) *Exported { Dir: temp, Env: append(os.Environ(), "GOPACKAGESDRIVER=off"), Overlay: make(map[string][]byte), + Tests: true, }, Modules: modules, temp: temp, diff --git a/internal/lsp/lsp_test.go b/internal/lsp/lsp_test.go index 73d614e3..94bad72a 100644 --- a/internal/lsp/lsp_test.go +++ b/internal/lsp/lsp_test.go @@ -36,7 +36,7 @@ func testLSP(t *testing.T, exporter packagestest.Exporter) { // We hardcode the expected number of test cases to ensure that all tests // are being executed. If a test is added, this number must be changed. const expectedCompletionsCount = 63 - const expectedDiagnosticsCount = 13 + const expectedDiagnosticsCount = 14 const expectedFormatCount = 3 const expectedDefinitionsCount = 16 const expectedTypeDefinitionsCount = 2 diff --git a/internal/lsp/testdata/testy/testy.go b/internal/lsp/testdata/testy/testy.go new file mode 100644 index 00000000..a72cef89 --- /dev/null +++ b/internal/lsp/testdata/testy/testy.go @@ -0,0 +1,3 @@ +package testy + +func a() {} diff --git a/internal/lsp/testdata/testy/testy_test.go b/internal/lsp/testdata/testy/testy_test.go new file mode 100644 index 00000000..b1e0c82d --- /dev/null +++ b/internal/lsp/testdata/testy/testy_test.go @@ -0,0 +1,8 @@ +package testy + +import "testing" + +func TestSomething(t *testing.T) { //@item(TestSomething, "TestSomething(t *testing.T)", "", "func") + var x int //@diag("x", "x declared but not used") + a() +}