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

Method EqualError

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

136// actualObj, err := SomeFunction()
137// a.EqualError(err, expectedErrorString)
138func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) {
139 if h, ok := a.t.(tHelper); ok {
140 h.Helper()
141 }
142 EqualError(a.t, theError, errString, msgAndArgs...)
143}
144
145// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
146// 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