[tools] gopls/internal/marker: make checkDiffs less fragile

1 view
Skip to first unread message

Peter Weinberger (Gerrit)

unread,
Dec 15, 2025, 1:14:15 PM (22 hours ago) Dec 15
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Alan Donovan, Go LUCI, golang-co...@googlegroups.com

Peter Weinberger submitted the change

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
Reviewed-by: Alan Donovan <adon...@google.com>
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:
  • requirement satisfiedCode-Review: +2 by Alan Donovan
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: Iabf6659a646bd69730d8ae19b1d46885a4903d90
Gerrit-Change-Number: 724660
Gerrit-PatchSet: 8
Gerrit-Owner: Peter Weinberger <p...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Peter Weinberger <p...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages