MCPcopy
hub / github.com/stretchr/testify / EqualErrorf

Function EqualErrorf

assert/assertion_format.go:92–97  ·  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

90// actualObj, err := SomeFunction()
91// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
92func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) bool {
93 if h, ok := t.(tHelper); ok {
94 h.Helper()
95 }
96 return EqualError(t, theError, errString, append([]interface{}{msg}, args...)...)
97}
98
99// EqualExportedValuesf asserts that the types of two objects are equal and their public
100// 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.65

Tested by

no test coverage detected