MCPcopy Create free account
hub / github.com/sergi/go-diff / diffRebuildTexts

Function diffRebuildTexts

diffmatchpatch/diff_test.go:48–61  ·  view source on GitHub ↗
(diffs []Diff)

Source from the content-addressed store, hash-verified

46}
47
48func diffRebuildTexts(diffs []Diff) []string {
49 texts := []string{"", ""}
50
51 for _, d := range diffs {
52 if d.Type != DiffInsert {
53 texts[0] += d.Text
54 }
55 if d.Type != DiffDelete {
56 texts[1] += d.Text
57 }
58 }
59
60 return texts
61}
62
63func TestDiffCommonPrefix(t *testing.T) {
64 type TestCase struct {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…