1 // Copyright 2020 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 func TestStdlibReferences(t *testing.T) {
26 run(t, files, func(t *testing.T, env *Env) {
27 env.OpenFile("main.go")
28 file, pos := env.GoToDefinition("main.go", env.RegexpSearch("main.go", `fmt.(Print)`))
29 refs, err := env.Editor.References(env.Ctx, file, pos)
34 t.Fatalf("got %v reference(s), want 2", len(refs))
36 // The first reference is guaranteed to be the definition.
37 if got, want := refs[1].URI, env.Sandbox.Workdir.URI("main.go"); got != want {
38 t.Errorf("found reference in %v, wanted %v", got, want)