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

Function ErrorContainsf

internal/testify/assert/assertion_format.go:145–150  ·  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() assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")

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

Source from the content-addressed store, hash-verified

143// actualObj, err := SomeFunction()
144// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
145func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool {
146 if h, ok := t.(tHelper); ok {
147 h.Helper()
148 }
149 return ErrorContains(t, theError, contains, append([]interface{}{msg}, args...)...)
150}
151
152// ErrorIsf asserts that at least one of the errors in err's chain matches target.
153// This is a wrapper for errors.Is.

Callers 2

ErrorContainsfFunction · 0.92
ErrorContainsfMethod · 0.70

Calls 2

ErrorContainsFunction · 0.70
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…