mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
also improve the actual verification of the unified diff Change-Id: I9c23c24e1fc8571cce2a7879463659ec7069fe99 Reviewed-on: https://go-review.googlesource.com/c/tools/+/199738 Run-TryBot: Ian Cottrell <iancottrell@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
20 lines
401 B
Go
20 lines
401 B
Go
package diff_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"golang.org/x/tools/internal/lsp/diff"
|
|
"golang.org/x/tools/internal/lsp/diff/difftest"
|
|
)
|
|
|
|
func TestApplyEdits(t *testing.T) {
|
|
for _, tc := range difftest.TestCases {
|
|
t.Run(tc.Name, func(t *testing.T) {
|
|
t.Helper()
|
|
if got := diff.ApplyEdits(tc.In, tc.Edits); got != tc.Out {
|
|
t.Errorf("ApplyEdits edits got %q, want %q", got, tc.Out)
|
|
}
|
|
})
|
|
}
|
|
}
|