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

Method ErrorContainsf

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

273// actualObj, err := SomeFunction()
274// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
275func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) {
276 if h, ok := a.t.(tHelper); ok {
277 h.Helper()
278 }
279 ErrorContainsf(a.t, theError, contains, msg, args...)
280}
281
282// ErrorIs asserts that at least one of the errors in err's chain matches target.
283// 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