diff --git a/util/update-manifest-releases/go.mod b/util/update-manifest-releases/go.mod index 67844d17..a82c34d4 100644 --- a/util/update-manifest-releases/go.mod +++ b/util/update-manifest-releases/go.mod @@ -6,7 +6,7 @@ toolchain go1.23.7 require ( github.com/onsi/ginkgo/v2 v2.27.5 - github.com/onsi/gomega v1.38.3 + github.com/onsi/gomega v1.39.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/util/update-manifest-releases/go.sum b/util/update-manifest-releases/go.sum index 3896ec0e..c7eec2d3 100644 --- a/util/update-manifest-releases/go.sum +++ b/util/update-manifest-releases/go.sum @@ -33,8 +33,8 @@ github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3v github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A= github.com/onsi/ginkgo/v2 v2.27.5 h1:ZeVgZMx2PDMdJm/+w5fE/OyG6ILo1Y3e+QX4zSR0zTE= github.com/onsi/ginkgo/v2 v2.27.5/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= -github.com/onsi/gomega v1.38.3 h1:eTX+W6dobAYfFeGC2PV6RwXRu/MyT+cQguijutvkpSM= -github.com/onsi/gomega v1.38.3/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4= +github.com/onsi/gomega v1.39.0 h1:y2ROC3hKFmQZJNFeGAMeHZKkjBL65mIZcvrLQBF9k6Q= +github.com/onsi/gomega v1.39.0/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= diff --git a/util/update-manifest-releases/vendor/github.com/onsi/gomega/CHANGELOG.md b/util/update-manifest-releases/vendor/github.com/onsi/gomega/CHANGELOG.md index 64b33e8b..cf020605 100644 --- a/util/update-manifest-releases/vendor/github.com/onsi/gomega/CHANGELOG.md +++ b/util/update-manifest-releases/vendor/github.com/onsi/gomega/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.39.0 + +### Features + +Add `MatchErrorStrictly` which only passes if `errors.Is(actual, expected)` returns true. `MatchError`, by contrast, will fallback to string comparison. + ## 1.38.3 ### Fixes diff --git a/util/update-manifest-releases/vendor/github.com/onsi/gomega/gomega_dsl.go b/util/update-manifest-releases/vendor/github.com/onsi/gomega/gomega_dsl.go index 55c0e895..cd6ce450 100644 --- a/util/update-manifest-releases/vendor/github.com/onsi/gomega/gomega_dsl.go +++ b/util/update-manifest-releases/vendor/github.com/onsi/gomega/gomega_dsl.go @@ -22,7 +22,7 @@ import ( "github.com/onsi/gomega/types" ) -const GOMEGA_VERSION = "1.38.3" +const GOMEGA_VERSION = "1.39.0" const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler. If you're using Ginkgo then you probably forgot to put your assertion in an It(). diff --git a/util/update-manifest-releases/vendor/github.com/onsi/gomega/matchers.go b/util/update-manifest-releases/vendor/github.com/onsi/gomega/matchers.go index 40ba15c5..16ca8f46 100644 --- a/util/update-manifest-releases/vendor/github.com/onsi/gomega/matchers.go +++ b/util/update-manifest-releases/vendor/github.com/onsi/gomega/matchers.go @@ -146,6 +146,24 @@ func MatchError(expected any, functionErrorDescription ...any) types.GomegaMatch } } +// MatchErrorStrictly succeeds iff actual is a non-nil error that matches the passed in +// expected error according to errors.Is(actual, expected). +// +// This behavior differs from MatchError where +// +// Expect(errors.New("some error")).To(MatchError(errors.New("some error"))) +// +// succeeds, but errors.Is would return false so: +// +// Expect(errors.New("some error")).To(MatchErrorStrictly(errors.New("some error"))) +// +// fails. +func MatchErrorStrictly(expected error) types.GomegaMatcher { + return &matchers.MatchErrorStrictlyMatcher{ + Expected: expected, + } +} + // BeClosed succeeds if actual is a closed channel. // It is an error to pass a non-channel to BeClosed, it is also an error to pass nil // diff --git a/util/update-manifest-releases/vendor/github.com/onsi/gomega/matchers/match_error_strictly_matcher.go b/util/update-manifest-releases/vendor/github.com/onsi/gomega/matchers/match_error_strictly_matcher.go new file mode 100644 index 00000000..63969b26 --- /dev/null +++ b/util/update-manifest-releases/vendor/github.com/onsi/gomega/matchers/match_error_strictly_matcher.go @@ -0,0 +1,39 @@ +package matchers + +import ( + "errors" + "fmt" + + "github.com/onsi/gomega/format" +) + +type MatchErrorStrictlyMatcher struct { + Expected error +} + +func (matcher *MatchErrorStrictlyMatcher) Match(actual any) (success bool, err error) { + + if isNil(matcher.Expected) { + return false, fmt.Errorf("Expected error is nil, use \"ToNot(HaveOccurred())\" to explicitly check for nil errors") + } + + if isNil(actual) { + return false, fmt.Errorf("Expected an error, got nil") + } + + if !isError(actual) { + return false, fmt.Errorf("Expected an error. Got:\n%s", format.Object(actual, 1)) + } + + actualErr := actual.(error) + + return errors.Is(actualErr, matcher.Expected), nil +} + +func (matcher *MatchErrorStrictlyMatcher) FailureMessage(actual any) (message string) { + return format.Message(actual, "to match error", matcher.Expected) +} + +func (matcher *MatchErrorStrictlyMatcher) NegatedFailureMessage(actual any) (message string) { + return format.Message(actual, "not to match error", matcher.Expected) +} diff --git a/util/update-manifest-releases/vendor/modules.txt b/util/update-manifest-releases/vendor/modules.txt index ac44380f..cc429967 100644 --- a/util/update-manifest-releases/vendor/modules.txt +++ b/util/update-manifest-releases/vendor/modules.txt @@ -42,7 +42,7 @@ github.com/onsi/ginkgo/v2/internal/reporters github.com/onsi/ginkgo/v2/internal/testingtproxy github.com/onsi/ginkgo/v2/reporters github.com/onsi/ginkgo/v2/types -# github.com/onsi/gomega v1.38.3 +# github.com/onsi/gomega v1.39.0 ## explicit; go 1.23.0 github.com/onsi/gomega github.com/onsi/gomega/format