@@ -23,10 +23,9 @@ import (
23
23
24
24
// Test for golang/go#53933
25
25
func TestBrokenWorkspace_DuplicateModules (t * testing.T ) {
26
- testenv .NeedsGo1Point (t , 18 )
27
-
28
- // TODO(golang/go#57650): fix this feature.
29
- t .Skip ("we no longer detect duplicate modules" )
26
+ // The go command error message was improved in Go 1.20 to mention multiple
27
+ // modules.
28
+ testenv .NeedsGo1Point (t , 20 )
30
29
31
30
// This proxy module content is replaced by the workspace, but is still
32
31
// required for module resolution to function in the Go command.
@@ -98,8 +97,8 @@ const CompleteMe = 222
98
97
ProxyFiles (proxy ),
99
98
).Run (t , src , func (t * testing.T , env * Env ) {
100
99
env .OpenFile ("package1/main.go" )
101
- env .Await (
102
- OutstandingWork (lsp .WorkspaceLoadFailure , `found module " example.com/foo" multiple times in the workspace` ),
100
+ env .AfterChange (
101
+ OutstandingWork (lsp .WorkspaceLoadFailure , `module example.com/foo appears multiple times in workspace` ),
103
102
)
104
103
105
104
// Remove the redundant vendored copy of example.com.
@@ -110,10 +109,10 @@ const CompleteMe = 222
110
109
./package2/vendor/example.com/foo
111
110
)
112
111
` )
113
- env .Await (NoOutstandingWork ())
112
+ env .AfterChange (NoOutstandingWork ())
114
113
115
114
// Check that definitions in package1 go to the copy vendored in package2.
116
- location := env .GoToDefinition (env .RegexpSearch ("package1/main.go" , "CompleteMe" )).URI . SpanURI (). Filename ( )
115
+ location := string ( env .GoToDefinition (env .RegexpSearch ("package1/main.go" , "CompleteMe" )).URI )
117
116
const wantLocation = "package2/vendor/example.com/foo/foo.go"
118
117
if ! strings .HasSuffix (location , wantLocation ) {
119
118
t .Errorf ("got definition of CompleteMe at %q, want %q" , location , wantLocation )
0 commit comments