go/internal/lsp/cmd/test
Robert Findley 4ccc73cbb5 internal/lsp/tests: simplify comparison of markdown at go1.18
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>
2022-08-31 21:08:24 +00:00
..
call_hierarchy.go internal/lsp: add outgoing calls call hierarchy 2020-08-20 01:08:01 +00:00
check.go internal/lsp: support regular expressions in Diagnostics tests 2022-08-29 18:21:50 +00:00
cmdtest.go internal/lsp/regtest: allow sharing memoized results across regtests 2022-07-26 21:20:42 +00:00
definition.go internal/lsp: hover to render go 1.19 doc comments 2022-08-19 18:26:38 +00:00
folding_range.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
format.go all: replace all usages of os/exec with golang.org/x/sys/execabs 2021-01-19 22:25:03 +00:00
highlight.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
implementation.go internal/lsp: store workspace package IDs with package paths 2020-01-09 22:04:34 +00:00
imports.go internal/lsp, gopls: recover from go-diff panics 2020-12-17 16:56:54 +00:00
links.go
prepare_rename.go internal/lsp/protocol: unmarshal to pointers when dispatching requests 2020-03-05 22:45:36 +00:00
references.go internal/lsp: add tests for references includeDeclaration setting 2020-01-23 01:39:50 +00:00
rename.go
semanticdriver.go internal/lsp: add semantic tokens for arrows in declarations 2022-04-07 14:52:22 +00:00
signature.go internal/lsp: normalize interface{} to any in test comparisons 2021-12-09 13:40:01 +00:00
suggested_fix.go internal/lsp/tests: simplify comparison of markdown at go1.18 2022-08-31 21:08:24 +00:00
symbols.go
workspace_symbol.go internal/lsp/tests: simplify comparison of markdown at go1.18 2022-08-31 21:08:24 +00:00