Change information
Commit message:
gopls/internal/marker: make checkDiffs less fragile
The marker tests make over 500 calls to checkDiffs, which currently
works by computing line diffs between the before code and the after code
and comparing these with the unified diffs that are
the golden contents in the test .txt file.
This is fragile, as a different diff algorithm would produce
different diffs, and we would like to remove the dependency on
myers.ComputeEdit.
This CL instead just checks that the unified golden diffs correctly
convert the before code into the after code. (Note that this
is a complete test of the new code on all existing uses in marker
tests.)
A subsequent CL will replace myers.ComputeEdit.
Change-Id: Iabf6659a646bd69730d8ae19b1d46885a4903d90
Files:
- M gopls/internal/test/marker/marker_test.go
- M internal/diff/unified.go
Change size: M
Delta: 2 files changed, 77 insertions(+), 23 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Alan Donovan
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI