Path: blob/main/vendor/github.com/onsi/gomega/matchers/not.go
2880 views
package matchers12import (3"github.com/onsi/gomega/types"4)56type NotMatcher struct {7Matcher types.GomegaMatcher8}910func (m *NotMatcher) Match(actual any) (bool, error) {11success, err := m.Matcher.Match(actual)12if err != nil {13return false, err14}15return !success, nil16}1718func (m *NotMatcher) FailureMessage(actual any) (message string) {19return m.Matcher.NegatedFailureMessage(actual) // works beautifully20}2122func (m *NotMatcher) NegatedFailureMessage(actual any) (message string) {23return m.Matcher.FailureMessage(actual) // works beautifully24}2526func (m *NotMatcher) MatchMayChangeInTheFuture(actual any) bool {27return types.MatchMayChangeInTheFuture(m.Matcher, actual) // just return m.Matcher's value28}293031