Skip to content

Commit b653051

Browse files
committed
internal/lsp/cmd: delete TestDefinitionHelpExample test
Fixes golang/go#32794 Change-Id: I52339d1c49d4737d9f562471777eae9db689f075 Reviewed-on: https://go-review.googlesource.com/c/tools/+/267122 Trust: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
1 parent ac612af commit b653051

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

internal/lsp/cmd/cmd_test.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@
55
package cmd_test
66

77
import (
8-
"fmt"
98
"os"
10-
"path/filepath"
11-
"regexp"
12-
"runtime"
139
"testing"
1410

15-
"golang.org/x/tools/internal/lsp/cmd"
1611
cmdtest "golang.org/x/tools/internal/lsp/cmd/test"
1712
"golang.org/x/tools/internal/lsp/tests"
1813
"golang.org/x/tools/internal/testenv"
@@ -26,31 +21,3 @@ func TestMain(m *testing.M) {
2621
func TestCommandLine(t *testing.T) {
2722
cmdtest.TestCommandLine(t, "../testdata", tests.DefaultOptions)
2823
}
29-
30-
func TestDefinitionHelpExample(t *testing.T) {
31-
// TODO: https://golang.org/issue/32794.
32-
t.Skip()
33-
if runtime.GOOS == "android" {
34-
t.Skip("not all source files are available on android")
35-
}
36-
dir, err := os.Getwd()
37-
if err != nil {
38-
t.Errorf("could not get wd: %v", err)
39-
return
40-
}
41-
ctx := tests.Context(t)
42-
ts := cmdtest.NewTestServer(ctx, nil)
43-
thisFile := filepath.Join(dir, "definition.go")
44-
baseArgs := []string{"query", "definition"}
45-
expect := regexp.MustCompile(`(?s)^[\w/\\:_-]+flag[/\\]flag.go:\d+:\d+-\d+: defined here as FlagSet struct {.*}$`)
46-
for _, query := range []string{
47-
fmt.Sprintf("%v:%v:%v", thisFile, cmd.ExampleLine, cmd.ExampleColumn),
48-
fmt.Sprintf("%v:#%v", thisFile, cmd.ExampleOffset)} {
49-
args := append(baseArgs, query)
50-
r := cmdtest.NewRunner(nil, ctx, ts.Addr, nil)
51-
got, _ := r.NormalizeGoplsCmd(t, args...)
52-
if !expect.MatchString(got) {
53-
t.Errorf("test with %v\nexpected:\n%s\ngot:\n%s", args, expect, got)
54-
}
55-
}
56-
}

0 commit comments

Comments
 (0)