File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -954,3 +954,42 @@ func _() {
954954 )
955955 }, WithoutWorkspaceFolders ())
956956}
957+
958+ // Reproduces the case described in
959+ // https://github.com/golang/go/issues/39296#issuecomment-652058883.
960+ func TestPkgm (t * testing.T ) {
961+ const basic = `
962+ -- go.mod --
963+ module mod.com
964+
965+ go 1.15
966+ -- foo/foo.go --
967+ package foo
968+
969+ import "fmt"
970+
971+ func Foo() {
972+ fmt.Println("")
973+ }
974+ `
975+ runner .Run (t , basic , func (t * testing.T , env * Env ) {
976+ testenv .NeedsGo1Point (t , 15 )
977+
978+ env .Await (
979+ CompletedWork (lsp .DiagnosticWorkTitle (lsp .FromInitialWorkspaceLoad ), 1 ),
980+ )
981+ env .WriteWorkspaceFile ("foo/foo_test.go" , `package main
982+
983+ func main() {
984+
985+ }` )
986+ env .OpenFile ("foo/foo_test.go" )
987+ env .RegexpReplace ("foo/foo_test.go" , `package main` , `package foo` )
988+ env .Await (
989+ OnceMet (
990+ CompletedWork (lsp .DiagnosticWorkTitle (lsp .FromDidChange ), 1 ),
991+ NoDiagnostics ("foo/foo.go" ),
992+ ),
993+ )
994+ })
995+ }
You can’t perform that action at this time.
0 commit comments