Documentation
¶
Overview ¶
Package p defines the built-in predicates for go-testpredicate
Index ¶
- func All(p predicate.T) predicate.T
- func AllKeys(p predicate.T) predicate.T
- func AllValues(p predicate.T) predicate.T
- func Any(p predicate.T) predicate.T
- func AnyKey(p predicate.T) predicate.T
- func AnyValue(p predicate.T) predicate.T
- func Capacity(p predicate.T) predicate.T
- func CloseTo(rhs interface{}, tolerance float64) predicate.T
- func Contains(rhs interface{}) predicate.T
- func EndsWith(rhs interface{}) predicate.T
- func Eq(rhs interface{}) predicate.T
- func Ge(rhs interface{}) predicate.T
- func GreaterOrEqualTo(rhs interface{}) predicate.T
- func GreaterThan(rhs interface{}) predicate.T
- func Gt(rhs interface{}) predicate.T
- func IsDisjointSetFrom(rhs interface{}) predicate.T
- func IsEmpty() predicate.T
- func IsEqualSet(rhs interface{}) predicate.T
- func IsEqualTo(rhs interface{}) predicate.T
- func IsError(expectedErr error) predicate.T
- func IsFalse() predicate.T
- func IsNil() predicate.T
- func IsNoError() predicate.T
- func IsNotEmpty() predicate.T
- func IsNotEqualTo(rhs interface{}) predicate.T
- func IsNotNil() predicate.T
- func IsSubsetOf(rhs interface{}) predicate.T
- func IsSupersetOf(rhs interface{}) predicate.T
- func IsTrue() predicate.T
- func Le(rhs interface{}) predicate.T
- func Length(p predicate.T) predicate.T
- func LessOrEqualTo(rhs interface{}) predicate.T
- func LessThan(rhs interface{}) predicate.T
- func Lt(rhs interface{}) predicate.T
- func MapKeys(p predicate.T) predicate.T
- func MapValues(p predicate.T) predicate.T
- func Matches(re string) predicate.T
- func Ne(rhs interface{}) predicate.T
- func Panics() predicate.T
- func PanicsAndResult(p predicate.T) predicate.T
- func StartsWith(rhs interface{}) predicate.T
- func ToLower(p predicate.T) predicate.T
- func ToString(p predicate.T) predicate.T
- func ToUpper(p predicate.T) predicate.T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capacity ¶
Capacity returns a predicate that checks if the capacity of a value matches the nested predicate. Applies to values of tpye Array, Slice or Channel.
func CloseTo ¶
CloseTo return a predicate to check if a value is almost equal to the reference value, within the specified tolerance. Value and reference value can numeric, or slice or array of numeric values, of equal size
func GreaterOrEqualTo ¶
GreaterOrEqualTo returns a predicate that check if a value is greater or equal to the specified value
func GreaterThan ¶
GreaterThan returns a predicate that check if a value is strictly greater than the specified value
func IsDisjointSetFrom ¶
IsDisjointSetFrom returns a predicate that checks
func IsEqualSet ¶
IsEqualSet returns a predicate that checks
func IsError ¶
IsError tests if an error value matches a specific error, using errros.Is() to support go v1.13 error wrapping
func IsNotEmpty ¶
IsNotEmpty returns a predicate that checks if a value is not nil
func IsNotEqualTo ¶
IsNotEqualTo tests if a value is comparable but different than the reference value
func IsSubsetOf ¶
IsSubsetOf returns a predicate that checks
func IsSupersetOf ¶
IsSupersetOf returns a predicate that checks
func Length ¶
Length returns a predicate that checks if the length of a value matches the nested predicate. Applies to values of tpye String, Array, Slice, Map, or Channel.
func LessOrEqualTo ¶
LessOrEqualTo returns a predicate that check if a value is less or equal to the specified value
func LessThan ¶
LessThan returns a predicate that check if a value is strictly less than the specified value
func Panics ¶
Panics returns a predicate that evaluates value as a callable function and expects it to panic.
func PanicsAndResult ¶
PanicsAndResult returns a predicate that evaluates value as a callable function, expect it to panic, and evaluate the panic value against the nested predicate
func StartsWith ¶
StartsWith returns a predicate that checks
func ToLower ¶
ToLower returns a predicate that checks if the lowercase version of a string passes the nested predicate
Types ¶
This section is empty.