1
0
mirror of https://github.com/golang/go synced 2024-09-30 12:28:35 -06:00

internal/lsp/regtest: reproduce empty xtest bug

packages.Load returns bad data for an empty xtest in GOPATH mode.

Updates golang/go#40825.

Change-Id: Ibab8dcbeafc22a71a2a4c3be0008b728c13c4c80
Reviewed-on: https://go-review.googlesource.com/c/tools/+/249703
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Heschi Kreinick 2020-08-21 15:10:18 -04:00
parent 3509cdc6e9
commit 3366bbee47

View File

@ -835,6 +835,25 @@ func TestHello(t *testing.T) {
})
}
// Reproduces golang/go#40825.
func TestEmptyGOPATHXTest_40825(t *testing.T) {
t.Skip("bug isn't fixed yet")
const files = `
-- x.go --
package x
-- x_test.go --
`
withOptions(InGOPATH()).run(t, files, func(t *testing.T, env *Env) {
env.OpenFile("x_test.go")
env.EditBuffer("x_test.go", fake.NewEdit(0, 0, 0, 0, "pack"))
env.Await(
CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidChange), 1),
NoShowMessage(),
)
})
}
func TestIgnoredFiles(t *testing.T) {
const ws = `
-- go.mod --