MCPcopy
hub / github.com/roboll/helmfile / Diff

Function Diff

pkg/testhelper/diff.go:13–24  ·  view source on GitHub ↗
(want, got string, context int)

Source from the content-addressed store, hash-verified

11)
12
13func Diff(want, got string, context int) (string, bool) {
14 records := difflib.Diff(
15 strings.Split(want, "\n"),
16 strings.Split(got, "\n"),
17 )
18
19 w := &bytes.Buffer{}
20
21 changed := checkAndPrintRecords(w, records, context)
22
23 return w.String(), changed
24}
25
26func checkAndPrintRecords(w io.Writer, records []difflib.DiffRecord, context int) bool {
27 var changed bool

Callers 9

TestApply_2Function · 0.92
TestSyncFunction · 0.92
TestApplyFunction · 0.92
TestDepsFunction · 0.92
TestDiffFunction · 0.92
TestDestroyFunction · 0.92
TestDiff_2Function · 0.92
TestApply_3Function · 0.92
TestDestroy_2Function · 0.92

Calls 2

checkAndPrintRecordsFunction · 0.85
DiffMethod · 0.80

Tested by 9

TestApply_2Function · 0.74
TestSyncFunction · 0.74
TestApplyFunction · 0.74
TestDepsFunction · 0.74
TestDiffFunction · 0.74
TestDestroyFunction · 0.74
TestDiff_2Function · 0.74
TestApply_3Function · 0.74
TestDestroy_2Function · 0.74