mirror of
https://github.com/golang/go
synced 2024-11-18 15:24:41 -07:00
internal/lsp/regtest: clean up module names and include github issues
A couple small improvements for regtests: - module names fixed to include a '.'. This was fixed for diagnostic tests already. - For regtests that were written to exercise specifig github issues, include the issue number in the test name. Change-Id: I67da6d78dc166e854d2543cf63dac382202f9dbc Reviewed-on: https://go-review.googlesource.com/c/tools/+/226844 Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
226fa68e9d
commit
8cb32c4661
@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
const internalDefinition = `
|
const internalDefinition = `
|
||||||
-- go.mod --
|
-- go.mod --
|
||||||
module mod
|
module mod.com
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
-- main.go --
|
-- main.go --
|
||||||
@ -43,7 +43,7 @@ func TestGoToInternalDefinition(t *testing.T) {
|
|||||||
|
|
||||||
const stdlibDefinition = `
|
const stdlibDefinition = `
|
||||||
-- go.mod --
|
-- go.mod --
|
||||||
module mod
|
module mod.com
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
-- main.go --
|
-- main.go --
|
||||||
@ -58,7 +58,7 @@ func main() {
|
|||||||
fmt.Println(time.Now())
|
fmt.Println(time.Now())
|
||||||
}`
|
}`
|
||||||
|
|
||||||
func TestGoToStdlibDefinition(t *testing.T) {
|
func TestGoToStdlibDefinition_Issue37045(t *testing.T) {
|
||||||
runner.Run(t, stdlibDefinition, func(env *Env) {
|
runner.Run(t, stdlibDefinition, func(env *Env) {
|
||||||
env.OpenFile("main.go")
|
env.OpenFile("main.go")
|
||||||
name, pos := env.GoToDefinition("main.go", env.RegexpSearch("main.go", "Now"))
|
name, pos := env.GoToDefinition("main.go", env.RegexpSearch("main.go", "Now"))
|
||||||
|
@ -92,7 +92,7 @@ func TestDiagnosticClearingOnEdit(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDiagnosticClearingOnDelete(t *testing.T) {
|
func TestDiagnosticClearingOnDelete_Issue37049(t *testing.T) {
|
||||||
runner.Run(t, badPackage, func(env *Env) {
|
runner.Run(t, badPackage, func(env *Env) {
|
||||||
env.OpenFile("a.go")
|
env.OpenFile("a.go")
|
||||||
env.Await(env.DiagnosticAtRegexp("a.go", "a = 1"), env.DiagnosticAtRegexp("b.go", "a = 2"))
|
env.Await(env.DiagnosticAtRegexp("a.go", "a = 1"), env.DiagnosticAtRegexp("b.go", "a = 2"))
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
const simpleProgram = `
|
const simpleProgram = `
|
||||||
-- go.mod --
|
-- go.mod --
|
||||||
module mod
|
module mod.com
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
-- main.go --
|
-- main.go --
|
||||||
|
Loading…
Reference in New Issue
Block a user