MCPcopy
hub / github.com/expr-lang/expr / EqualErrorf

Function EqualErrorf

internal/testify/require/require.go:186–194  ·  view source on GitHub ↗

EqualErrorf asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction() assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")

(t TestingT, theError error, errString string, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

184// actualObj, err := SomeFunction()
185// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
186func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) {
187 if h, ok := t.(tHelper); ok {
188 h.Helper()
189 }
190 if assert.EqualErrorf(t, theError, errString, msg, args...) {
191 return
192 }
193 t.FailNow()
194}
195
196// EqualExportedValues asserts that the types of two objects are equal and their public
197// fields are also equal. This is useful for comparing structs that have private fields

Callers 1

EqualErrorfMethod · 0.70

Calls 3

EqualErrorfFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…