Documentation
¶
Overview ¶
Package match provides matchers to use with mocka for stubbing functions with custom arguments.
Index ¶
- func Priority(m SupportedKindsMatcher) float64
- type SupportedKindsMatcher
- func Anything() SupportedKindsMatcher
- func AnythingButNil() SupportedKindsMatcher
- func ConvertibleTo(value interface{}) SupportedKindsMatcher
- func ElementsContaining(elements ...interface{}) SupportedKindsMatcher
- func Empty() SupportedKindsMatcher
- func Exactly(value interface{}) SupportedKindsMatcher
- func FloatGreaterThan(value float64) SupportedKindsMatcher
- func FloatGreaterThanOrEqualTo(value float64) SupportedKindsMatcher
- func FloatLessThan(value float64) SupportedKindsMatcher
- func FloatLessThanOrEqualTo(value float64) SupportedKindsMatcher
- func ImplementerOf(value interface{}) SupportedKindsMatcher
- func IntGreaterThan(value int64) SupportedKindsMatcher
- func IntGreaterThanOrEqualTo(value int64) SupportedKindsMatcher
- func IntLessThan(value int64) SupportedKindsMatcher
- func IntLessThanOrEqualTo(value int64) SupportedKindsMatcher
- func KeysContaining(keys ...interface{}) SupportedKindsMatcher
- func LengthOf(length int) SupportedKindsMatcher
- func Nil() SupportedKindsMatcher
- func StringContaining(substring string) SupportedKindsMatcher
- func StringPrefix(prefix string) SupportedKindsMatcher
- func StringSuffix(suffix string) SupportedKindsMatcher
- func TypeOf(value string) SupportedKindsMatcher
- func UintGreaterThan(value uint64) SupportedKindsMatcher
- func UintGreaterThanOrEqualTo(value uint64) SupportedKindsMatcher
- func UintLessThan(value uint64) SupportedKindsMatcher
- func UintLessThanOrEqualTo(value uint64) SupportedKindsMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Priority ¶
func Priority(m SupportedKindsMatcher) float64
Priority returns the matchers priority to be compared against
Types ¶
type SupportedKindsMatcher ¶
type SupportedKindsMatcher interface {
// SupportedKinds returns the supported kinds for the matcher
SupportedKinds() map[reflect.Kind]struct{}
// Match return true is the match was successful; otherwise false
Match(interface{}) bool
}
SupportedKindsMatcher describes the functionality of a custom argument matcher for mocka
func Anything ¶
func Anything() SupportedKindsMatcher
Anything returns a new matcher that will match any value
func AnythingButNil ¶
func AnythingButNil() SupportedKindsMatcher
AnythingButNil returns a new matcher that will match any value except nil
func ConvertibleTo ¶
func ConvertibleTo(value interface{}) SupportedKindsMatcher
ConvertibleTo returns a new matcher that will match a value if it can be converted to the provided type
func ElementsContaining ¶
func ElementsContaining(elements ...interface{}) SupportedKindsMatcher
ElementsContaining returns a new matcher that will match the existence of elements in a slice or array
func Empty ¶
func Empty() SupportedKindsMatcher
Empty returns a new matcher that will match empty strings, slices, arrays, and maps
func Exactly ¶
func Exactly(value interface{}) SupportedKindsMatcher
Exactly returns a new matcher for matching exact values with reflect.DeepEqual
func FloatGreaterThan ¶
func FloatGreaterThan(value float64) SupportedKindsMatcher
FloatGreaterThan returns a new matcher that will match float's greater than the provided float
func FloatGreaterThanOrEqualTo ¶
func FloatGreaterThanOrEqualTo(value float64) SupportedKindsMatcher
FloatGreaterThanOrEqualTo returns a new matcher that will match float's greater than or equal to the provided float
func FloatLessThan ¶
func FloatLessThan(value float64) SupportedKindsMatcher
FloatLessThan returns a new matcher that will match float's less than the provided float
func FloatLessThanOrEqualTo ¶
func FloatLessThanOrEqualTo(value float64) SupportedKindsMatcher
FloatLessThanOrEqualTo returns a new matcher that will match float's less than or equal to the provided float
func ImplementerOf ¶
func ImplementerOf(value interface{}) SupportedKindsMatcher
ImplementerOf returns a new matcher that will match a value if it implements the provided interface
func IntGreaterThan ¶
func IntGreaterThan(value int64) SupportedKindsMatcher
IntGreaterThan returns a new matcher that will match int's greater than the provided int
func IntGreaterThanOrEqualTo ¶
func IntGreaterThanOrEqualTo(value int64) SupportedKindsMatcher
IntGreaterThanOrEqualTo returns a new matcher that will match int's greater than or equal to the provided int
func IntLessThan ¶
func IntLessThan(value int64) SupportedKindsMatcher
IntLessThan returns a new matcher that will match int's less than the provided int
func IntLessThanOrEqualTo ¶
func IntLessThanOrEqualTo(value int64) SupportedKindsMatcher
IntLessThanOrEqualTo returns a new matcher that will match int's less than or equal to the provided int
func KeysContaining ¶
func KeysContaining(keys ...interface{}) SupportedKindsMatcher
KeysContaining returns a new matcher that will match the existence of map keys
func LengthOf ¶
func LengthOf(length int) SupportedKindsMatcher
LengthOf returns a new matcher that will match the length of strings, slices, arrays, and maps
func StringContaining ¶
func StringContaining(substring string) SupportedKindsMatcher
StringContaining returns a new matcher that will match is the substring is found
func StringPrefix ¶
func StringPrefix(prefix string) SupportedKindsMatcher
StringPrefix returns a new matcher that will match the provided prefix
func StringSuffix ¶
func StringSuffix(suffix string) SupportedKindsMatcher
StringSuffix returns a new matcher that will match the provided suffix
func TypeOf ¶
func TypeOf(value string) SupportedKindsMatcher
TypeOf returns a new matcher that will match if the type names match
func UintGreaterThan ¶
func UintGreaterThan(value uint64) SupportedKindsMatcher
UintGreaterThan returns a new matcher that will match uint's greater than the provided uint
func UintGreaterThanOrEqualTo ¶
func UintGreaterThanOrEqualTo(value uint64) SupportedKindsMatcher
UintGreaterThanOrEqualTo returns a new matcher that will match uint's greater than or equal to the provided uint
func UintLessThan ¶
func UintLessThan(value uint64) SupportedKindsMatcher
UintLessThan returns a new matcher that will match uint's less than the provided uint
func UintLessThanOrEqualTo ¶
func UintLessThanOrEqualTo(value uint64) SupportedKindsMatcher
UintLessThanOrEqualTo returns a new matcher that will match uint's less than or equal to the provided uint
Source Files
¶
- anything.go
- anythingButNil.go
- convertibleTo.go
- elementsContaining.go
- empty.go
- exactly.go
- floatGreaterThan.go
- floatGreaterThanOrEqualTo.go
- floatLessThan.go
- floatLessThanOrEqualTo.go
- implementerOf.go
- intGreaterThan.go
- intGreaterThanOrEqualTo.go
- intLessThan.go
- intLessThanOrEqualTo.go
- keysContaining.go
- lengthOf.go
- match.go
- nil.go
- priority.go
- stringContaining.go
- stringPrefix.go
- stringSuffix.go
- typeOf.go
- uintGreaterThan.go
- uintGreaterThanOrEqualTo.go
- uintLessThan.go
- uintLessThanOrEqualTo.go