MCPcopy
hub / github.com/google/mtail / ExpectNoDiff

Function ExpectNoDiff

internal/testutil/diff.go:38–45  ·  view source on GitHub ↗

ExpectNoDiff tests to see if the two interfaces have no diff. If there is no diff, the retrun value is true. If there is a diff, it is logged to tb and an error is flagged, and the return value is false.

(tb testing.TB, a, b interface{}, opts ...cmp.Option)

Source from the content-addressed store, hash-verified

36// If there is no diff, the retrun value is true.
37// If there is a diff, it is logged to tb and an error is flagged, and the return value is false.
38func ExpectNoDiff(tb testing.TB, a, b interface{}, opts ...cmp.Option) bool {
39 tb.Helper()
40 if diff := Diff(a, b, opts...); diff != "" {
41 tb.Errorf("Unexpected diff, -want +got:\n%s", diff)
42 return false
43 }
44 return true
45}

Callers 15

TestEmitLabelSetFunction · 0.92
TestAppendLabelValueFunction · 0.92
TestMetricJSONRoundTripFunction · 0.92
TestTimerFunction · 0.92
TestMarshalJSONFunction · 0.92
TestExampleProgramsFunction · 0.92
TestReadTestDataFunction · 0.92
TestRuntimeEndToEndFunction · 0.92
TestCheckInvalidProgramsFunction · 0.92
TestCheckTypeExpressionsFunction · 0.92

Calls 1

DiffFunction · 0.85

Tested by 15

TestEmitLabelSetFunction · 0.74
TestAppendLabelValueFunction · 0.74
TestMetricJSONRoundTripFunction · 0.74
TestTimerFunction · 0.74
TestMarshalJSONFunction · 0.74
TestExampleProgramsFunction · 0.74
TestReadTestDataFunction · 0.74
TestRuntimeEndToEndFunction · 0.74
TestCheckInvalidProgramsFunction · 0.74
TestCheckTypeExpressionsFunction · 0.74