Documentation ¶
Overview ¶
Package to exposes all the core matchers that can be used with the should.Expect[E] functions.
Index ¶
- func All(matchers ...matcher.Matcher) matcher.Matcher
- func Any(matchers ...matcher.Matcher) matcher.Matcher
- func Anything() matcher.Matcher
- func BeEmpty() matcher.Matcher
- func BeFalse() matcher.Matcher
- func BeNil() matcher.Matcher
- func BeNumerically(comparator string, compareTo ...interface{}) matcher.Matcher
- func BeTrue() matcher.Matcher
- func BeZero() matcher.Matcher
- func ConsistOf(elements ...interface{}) matcher.Matcher
- func ContainElements(elements ...interface{}) matcher.Matcher
- func ContainSubstring(substr string, args ...interface{}) matcher.Matcher
- func Equal(expected interface{}) matcher.Matcher
- func Equivalent(expected interface{}) matcher.Matcher
- func HaveKey(key interface{}) matcher.Matcher
- func HaveKeyAndValue(key, value interface{}) matcher.Matcher
- func HaveLen(count int) matcher.Matcher
- func MatchRegexp(regexp string, args ...interface{}) matcher.Matcher
- func Not(matcher matcher.Matcher) matcher.Matcher
- func Success() matcher.Matcher
- func WithTransform(transform interface{}, matcher matcher.Matcher) matcher.Matcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeNumerically ¶
BeNumerically checks whenever actual satisfies the comparison.
func ConsistOf ¶
ConsistOf checks whenever actual consists of the expected elements (no more, no less).
func ContainElements ¶
ContainElements checks if actual contains all the given elements. Ordering does not matter, and you can nest other matchers for the elements.
func ContainSubstring ¶
ContainSubstring checks that actual contains the given substring, additional arguments can be passed to construct a formatted string with fmt.Sprintf.
func Equivalent ¶
Equivalent to is like Equal, but a little bit more flexible when checking for equality, for example, int(3) is equivalent to float(3.0).
func HaveKeyAndValue ¶
HaveKeyAndValue checks whenever actual is a map and contains the expected key and value.
func HaveLen ¶
HaveLen checks that actual as the given length (it has to be either a string, slice, map, channel, etc).
func MatchRegexp ¶
MatchRegexp checks that actual matches the given regular expression, additional arguments can be passed to construct a formatted regex with fmt.Sprintf.
Types ¶
This section is empty.