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

Method EqualErrorf

require/require_forward.go:167–172  ·  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() a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted")

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

Source from the content-addressed store, hash-verified

165// actualObj, err := SomeFunction()
166// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted")
167func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) {
168 if h, ok := a.t.(tHelper); ok {
169 h.Helper()
170 }
171 EqualErrorf(a.t, theError, errString, msg, args...)
172}
173
174// EqualExportedValues asserts that the types of two objects are equal and their public
175// fields are also equal. This is useful for comparing structs that have private fields

Callers

nothing calls this directly

Calls 2

EqualErrorfFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected