Documentation
¶
Overview ¶
Package matcher provides value matchers.
Index ¶
- Variables
- type Callback
- type Matcher
- func Equal(expected any) Matcher
- func Equalf(expected string, args ...any) Matcher
- func Func(expected string, match func(actual any) (bool, error)) Matcher
- func IsEmpty() Matcher
- func IsNotEmpty() Matcher
- func IsType() Matcher
- func JSON(expected any) Matcher
- func Len(expected T) Matcher
- func Match(v any) Matcher
- func Regex(regexp T) Matcher
- func SameTypeAs(expected any) Matcher
Constants ¶
This section is empty.
Variables ¶
Any returns a matcher that matches any value.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func() Matcher
Callback matches by calling a function.
type Matcher ¶
Matcher determines if the actual matches the expectation.
func Len ¶
func Len[T ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64](expected T) Matcher
Len matches by the length of the value.