mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:10 -07:00
0ae87fff1b
except the race was a symptom of a larger problem, so the fix actually invovles cleaning up the way we run command line tests totally to have common shared infrastructure, and also to clean up the way we handle errors and paths into the temporary directory Fixes: golang/go#35436 Change-Id: I4c5602607bb70e082056132baa3d4b0f8df6b13b Reviewed-on: https://go-review.googlesource.com/c/tools/+/208269 Run-TryBot: Ian Cottrell <iancottrell@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
22 lines
512 B
Go
22 lines
512 B
Go
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)
|
|
}
|
|
}
|