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

Method ErrorContainsf

internal/testify/assert/assertion_forward.go:273–278  ·  view source on GitHub ↗

ErrorContainsf asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := SomeFunction() a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")

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

Source from the content-addressed store, hash-verified

271// actualObj, err := SomeFunction()
272// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
273func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) bool {
274 if h, ok := a.t.(tHelper); ok {
275 h.Helper()
276 }
277 return ErrorContainsf(a.t, theError, contains, msg, args...)
278}
279
280// ErrorIs asserts that at least one of the errors in err's chain matches target.
281// This is a wrapper for errors.Is.

Callers

nothing calls this directly

Calls 2

ErrorContainsfFunction · 0.70
HelperMethod · 0.45

Tested by

no test coverage detected