mirror of https://github.com/golang/go.git
In several places throughout the x/tools codebase, the internal/lsp/diff package is used to provide clearer test output when comparing large, multi-line strings. In some places, this is implemented via the tests.Diff helper function, but in others it is not (presumably due to import cycles). Factor out this pattern into a diff.Pretty function, and add commentary. Also remove the *testing.T argument, as diffs should never fail; opt to panic instead. Also add a test. Using this function, simplify the logic to comparing our 1.18 markdown output with 1.19 golden content, by normalizing differences between the two. This is necessary as markdown content will change as a result of moving internal/lsp to gopls/internal/lsp. For golang/go#54509 Change-Id: Ie1fea1091bbbeb49e00c4efa7e02707cafa415cc Reviewed-on: https://go-review.googlesource.com/c/tools/+/426776 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> |
||
|---|---|---|
| .. | ||
| test | ||
| usage | ||
| call_hierarchy.go | ||
| capabilities_test.go | ||
| check.go | ||
| cmd.go | ||
| cmd_test.go | ||
| definition.go | ||
| export_test.go | ||
| folding_range.go | ||
| format.go | ||
| help_test.go | ||
| highlight.go | ||
| implementation.go | ||
| imports.go | ||
| info.go | ||
| links.go | ||
| prepare_rename.go | ||
| references.go | ||
| remote.go | ||
| rename.go | ||
| semantictokens.go | ||
| serve.go | ||
| signature.go | ||
| subcommands.go | ||
| suggested_fix.go | ||
| symbols.go | ||
| vulncheck.go | ||
| workspace.go | ||
| workspace_symbol.go | ||