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

Function EqualErrorf

internal/testify/assert/assertion_format.go:83–88  ·  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

81// actualObj, err := SomeFunction()
82// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
83func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) bool {
84 if h, ok := t.(tHelper); ok {
85 h.Helper()
86 }
87 return EqualError(t, theError, errString, append([]interface{}{msg}, args...)...)
88}
89
90// EqualExportedValuesf asserts that the types of two objects are equal and their public
91// fields are also equal. This is useful for comparing structs that have private fields

Callers 2

EqualErrorfFunction · 0.92
EqualErrorfMethod · 0.70

Calls 2

EqualErrorFunction · 0.70
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…