MCPcopy
hub / github.com/perkeep/perkeep / compareConfigurations

Function compareConfigurations

pkg/serverinit/serverinit_test.go:225–234  ·  view source on GitHub ↗
(t *testing.T, name, g interface{}, w interface{})

Source from the content-addressed store, hash-verified

223}
224
225func compareConfigurations(t *testing.T, name, g interface{}, w interface{}) {
226 var got, want bytes.Buffer
227 prettyPrint(t, &got, g)
228 prettyPrint(t, &want, w)
229
230 if got.String() != want.String() {
231 t.Errorf("test %s configurations differ.\nGot:\n%s\nWant:\n%s\nDiff (want -> got), %s:\n%s",
232 name, &got, &want, name, test.Diff(want.Bytes(), got.Bytes()))
233 }
234}
235
236func canonicalizeGolden(t *testing.T, v []byte) []byte {
237 localPath, err := filepath.Abs(relativeRing)

Callers 4

testConfigFunction · 0.85
TestGenerateClientConfigFunction · 0.85

Calls 3

DiffFunction · 0.92
prettyPrintFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected