1 // Copyright 2019 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.
12 "golang.org/x/tools/internal/span"
15 func (r *runner) Implementation(t *testing.T, spn span.Span, imps []span.Span) {
16 var itemStrings []string
17 for _, i := range imps {
18 itemStrings = append(itemStrings, fmt.Sprint(i))
20 sort.Strings(itemStrings)
22 for _, i := range itemStrings {
25 expect = r.Normalize(expect)
28 filename := uri.Filename()
29 target := filename + fmt.Sprintf(":%v:%v", spn.Start().Line(), spn.Start().Column())
31 got, stderr := r.NormalizeGoplsCmd(t, "implementation", target)
33 t.Errorf("implementation failed for %s: %s", target, stderr)
34 } else if expect != got {
35 t.Errorf("implementation failed for %s expected:\n%s\ngot:\n%s", target, expect, got)