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

Method EqualErrorf

internal/testify/require/require_forward.go:150–155  ·  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

148// actualObj, err := SomeFunction()
149// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted")
150func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) {
151 if h, ok := a.t.(tHelper); ok {
152 h.Helper()
153 }
154 EqualErrorf(a.t, theError, errString, msg, args...)
155}
156
157// EqualExportedValues asserts that the types of two objects are equal and their public
158// 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.45

Tested by

no test coverage detected