go/internal/lsp/diff/diff_test.go
Ian Cottrell 6ac766747f internal/lsp: merge diffing test data sets
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>
2019-10-10 20:13:25 +00:00

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)
}
})
}
}