mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-25 07:40:19 +00:00
e8efa272a6
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.13.0 to 1.16.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.13.0...v1.16.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
30 lines
750 B
Go
30 lines
750 B
Go
package matchers
|
|
|
|
import (
|
|
"github.com/onsi/gomega/types"
|
|
)
|
|
|
|
type NotMatcher struct {
|
|
Matcher types.GomegaMatcher
|
|
}
|
|
|
|
func (m *NotMatcher) Match(actual interface{}) (bool, error) {
|
|
success, err := m.Matcher.Match(actual)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
return !success, nil
|
|
}
|
|
|
|
func (m *NotMatcher) FailureMessage(actual interface{}) (message string) {
|
|
return m.Matcher.NegatedFailureMessage(actual) // works beautifully
|
|
}
|
|
|
|
func (m *NotMatcher) NegatedFailureMessage(actual interface{}) (message string) {
|
|
return m.Matcher.FailureMessage(actual) // works beautifully
|
|
}
|
|
|
|
func (m *NotMatcher) MatchMayChangeInTheFuture(actual interface{}) bool {
|
|
return types.MatchMayChangeInTheFuture(m.Matcher, actual) // just return m.Matcher's value
|
|
}
|