aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/stretchr/testify/assert/assertion_format.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-18 12:46:38 +0100
committerGitHub <noreply@github.com>2022-03-18 12:46:38 +0100
commite471bf532c751c4f775d8d9f5f8bba35104acbb5 (patch)
tree9fcd93496d1d479f188f67545ba9dd1dca1be09e /vendor/github.com/stretchr/testify/assert/assertion_format.go
parente00e06de9ab8c9c26b4248f673db09bf3667917c (diff)
parentc732adf2d0a243a829798226c75447e235f88aa6 (diff)
downloadpodman-e471bf532c751c4f775d8d9f5f8bba35104acbb5.tar.gz
podman-e471bf532c751c4f775d8d9f5f8bba35104acbb5.tar.bz2
podman-e471bf532c751c4f775d8d9f5f8bba35104acbb5.zip
Merge pull request #13528 from containers/dependabot/go_modules/github.com/stretchr/testify-1.7.1
build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1
Diffstat (limited to 'vendor/github.com/stretchr/testify/assert/assertion_format.go')
-rw-r--r--vendor/github.com/stretchr/testify/assert/assertion_format.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go
index 4dfd1229a..27e2420ed 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_format.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go
@@ -123,6 +123,18 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int
return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...)
}
+// 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")
+func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return ErrorContains(t, theError, contains, append([]interface{}{msg}, args...)...)
+}
+
// ErrorIsf asserts that at least one of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool {