1
0
mirror of https://github.com/golang/go synced 2024-11-05 23:26:18 -07:00
go/internal/lsp/cmd/test/folding_range.go

22 lines
512 B
Go
Raw Normal View History

package cmdtest
import (
"testing"
"golang.org/x/tools/internal/span"
)
func (r *runner) FoldingRanges(t *testing.T, spn span.Span) {
goldenTag := "foldingRange-cmd"
uri := spn.URI()
filename := uri.Filename()
got, _ := r.NormalizeGoplsCmd(t, "folding_ranges", filename)
expect := string(r.data.Golden(goldenTag, filename, func() ([]byte, error) {
return []byte(got), nil
}))
if expect != got {
t.Errorf("folding_ranges failed failed for %s expected:\n%s\ngot:\n%s", filename, expect, got)
}
}