MCPcopy Index your code
hub / github.com/expr-lang/expr / EqualError

Method EqualError

internal/testify/assert/assertion_forward.go:136–141  ·  view source on GitHub ↗

EqualError asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction() a.EqualError(err, expectedErrorString)

(theError error, errString string, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

134// actualObj, err := SomeFunction()
135// a.EqualError(err, expectedErrorString)
136func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool {
137 if h, ok := a.t.(tHelper); ok {
138 h.Helper()
139 }
140 return EqualError(a.t, theError, errString, msgAndArgs...)
141}
142
143// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
144// and that it is equal to the provided error.

Callers 1

TestEqualErrorWrapperFunction · 0.45

Calls 2

EqualErrorFunction · 0.70
HelperMethod · 0.45

Tested by 1

TestEqualErrorWrapperFunction · 0.36