Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
kardolus
GitHub Repository: kardolus/chatgpt-cli
Path: blob/main/vendor/github.com/onsi/gomega/matchers/not.go
2880 views
1
package matchers
2
3
import (
4
"github.com/onsi/gomega/types"
5
)
6
7
type NotMatcher struct {
8
Matcher types.GomegaMatcher
9
}
10
11
func (m *NotMatcher) Match(actual any) (bool, error) {
12
success, err := m.Matcher.Match(actual)
13
if err != nil {
14
return false, err
15
}
16
return !success, nil
17
}
18
19
func (m *NotMatcher) FailureMessage(actual any) (message string) {
20
return m.Matcher.NegatedFailureMessage(actual) // works beautifully
21
}
22
23
func (m *NotMatcher) NegatedFailureMessage(actual any) (message string) {
24
return m.Matcher.FailureMessage(actual) // works beautifully
25
}
26
27
func (m *NotMatcher) MatchMayChangeInTheFuture(actual any) bool {
28
return types.MatchMayChangeInTheFuture(m.Matcher, actual) // just return m.Matcher's value
29
}
30
31