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

Method ErrorContains

internal/testify/require/require_forward.go:263–268  ·  view source on GitHub ↗

ErrorContains asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := SomeFunction() a.ErrorContains(err, expectedErrorSubString)

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

Source from the content-addressed store, hash-verified

261// actualObj, err := SomeFunction()
262// a.ErrorContains(err, expectedErrorSubString)
263func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) {
264 if h, ok := a.t.(tHelper); ok {
265 h.Helper()
266 }
267 ErrorContains(a.t, theError, contains, msgAndArgs...)
268}
269
270// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
271// and that the error contains the specified substring.

Callers 1

TestErrorContainsWrapperFunction · 0.45

Calls 2

ErrorContainsFunction · 0.70
HelperMethod · 0.45

Tested by 1

TestErrorContainsWrapperFunction · 0.36