mirror of https://github.com/golang/go.git
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>
This commit is contained in:
parent
ac612affd5
commit
b653051172
|
|
@ -5,14 +5,9 @@
|
|||
package cmd_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/tools/internal/lsp/cmd"
|
||||
cmdtest "golang.org/x/tools/internal/lsp/cmd/test"
|
||||
"golang.org/x/tools/internal/lsp/tests"
|
||||
"golang.org/x/tools/internal/testenv"
|
||||
|
|
@ -26,31 +21,3 @@ func TestMain(m *testing.M) {
|
|||
func TestCommandLine(t *testing.T) {
|
||||
cmdtest.TestCommandLine(t, "../testdata", tests.DefaultOptions)
|
||||
}
|
||||
|
||||
func TestDefinitionHelpExample(t *testing.T) {
|
||||
// TODO: https://golang.org/issue/32794.
|
||||
t.Skip()
|
||||
if runtime.GOOS == "android" {
|
||||
t.Skip("not all source files are available on android")
|
||||
}
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Errorf("could not get wd: %v", err)
|
||||
return
|
||||
}
|
||||
ctx := tests.Context(t)
|
||||
ts := cmdtest.NewTestServer(ctx, nil)
|
||||
thisFile := filepath.Join(dir, "definition.go")
|
||||
baseArgs := []string{"query", "definition"}
|
||||
expect := regexp.MustCompile(`(?s)^[\w/\\:_-]+flag[/\\]flag.go:\d+:\d+-\d+: defined here as FlagSet struct {.*}$`)
|
||||
for _, query := range []string{
|
||||
fmt.Sprintf("%v:%v:%v", thisFile, cmd.ExampleLine, cmd.ExampleColumn),
|
||||
fmt.Sprintf("%v:#%v", thisFile, cmd.ExampleOffset)} {
|
||||
args := append(baseArgs, query)
|
||||
r := cmdtest.NewRunner(nil, ctx, ts.Addr, nil)
|
||||
got, _ := r.NormalizeGoplsCmd(t, args...)
|
||||
if !expect.MatchString(got) {
|
||||
t.Errorf("test with %v\nexpected:\n%s\ngot:\n%s", args, expect, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue