From f5bda9994d5e6cb1ee42ade5e7786059feedf633 Mon Sep 17 00:00:00 2001 From: TomSweeneyRedHat Date: Tue, 14 Jan 2020 14:46:46 -0500 Subject: Bump to Buildah v1.13.1 Signed-off-by: TomSweeneyRedHat --- .../onsi/gomega/matchers/match_error_matcher.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'vendor/github.com/onsi/gomega/matchers/match_error_matcher.go') diff --git a/vendor/github.com/onsi/gomega/matchers/match_error_matcher.go b/vendor/github.com/onsi/gomega/matchers/match_error_matcher.go index 07499ac95..4e09239ff 100644 --- a/vendor/github.com/onsi/gomega/matchers/match_error_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/match_error_matcher.go @@ -5,6 +5,7 @@ import ( "reflect" "github.com/onsi/gomega/format" + "golang.org/x/xerrors" ) type MatchErrorMatcher struct { @@ -21,25 +22,28 @@ func (matcher *MatchErrorMatcher) Match(actual interface{}) (success bool, err e } actualErr := actual.(error) + expected := matcher.Expected - if isError(matcher.Expected) { - return reflect.DeepEqual(actualErr, matcher.Expected), nil + if isError(expected) { + return reflect.DeepEqual(actualErr, expected) || xerrors.Is(actualErr, expected.(error)), nil } - if isString(matcher.Expected) { - return actualErr.Error() == matcher.Expected, nil + if isString(expected) { + return actualErr.Error() == expected, nil } var subMatcher omegaMatcher var hasSubMatcher bool - if matcher.Expected != nil { - subMatcher, hasSubMatcher = (matcher.Expected).(omegaMatcher) + if expected != nil { + subMatcher, hasSubMatcher = (expected).(omegaMatcher) if hasSubMatcher { return subMatcher.Match(actualErr.Error()) } } - return false, fmt.Errorf("MatchError must be passed an error, string, or Matcher that can match on strings. Got:\n%s", format.Object(matcher.Expected, 1)) + return false, fmt.Errorf( + "MatchError must be passed an error, a string, or a Matcher that can match on strings. Got:\n%s", + format.Object(expected, 1)) } func (matcher *MatchErrorMatcher) FailureMessage(actual interface{}) (message string) { -- cgit v1.2.3-54-g00ecf