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

internal/lsp/regtest: add test for issue 32149 (wrong package)

Gopls gets confused about the package if the package name is edited.
(See golang.org/issues/32149) This skipped test will succeed as long
as the bug is present.

Change-Id: Ic99ceda133f92f306baf94e2f8ad0381ed565814
Reviewed-on: https://go-review.googlesource.com/c/tools/+/227760
Run-TryBot: Peter Weinberger <pjw@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
pjw 2020-04-09 10:01:18 -04:00 committed by Peter Weinberger
parent bc09a2cac9
commit 700752c244

View File

@ -241,3 +241,21 @@ func Test_Issue38267(t *testing.T) {
)
})
}
const packageChange = `
-- go.mod --
module fake
-- a.go --
package foo
func main() {}
`
func TestPackageChange(t *testing.T) {
t.Skip("skipping due to golang.org/issues/32149")
runner.Run(t, packageChange, func(env *Env) {
env.OpenFile("a.go")
env.RegexpReplace("a.go", "foo", "foox")
// TODO: there should be no error
env.Await(EmptyDiagnostics("a.go"))
})
}