Documentation ¶
Overview ¶
Package be_math provides Be matchers for mathematical operations
Index ¶
- func Approx(compareTo, threshold any) types.BeMatcher
- func ApproxZero() types.BeMatcher
- func DivisibleBy(divisor any) types.BeMatcher
- func Even() types.BeMatcher
- func GreaterThan(arg any) types.BeMatcher
- func GreaterThanEqual(arg any) types.BeMatcher
- func Gt(arg any) types.BeMatcher
- func Gte(arg any) types.BeMatcher
- func InRange(from any, fromInclusive bool, until any, untilInclusive bool) types.BeMatcher
- func Integral() types.BeMatcher
- func LessThan(arg any) types.BeMatcher
- func LessThanEqual(arg any) types.BeMatcher
- func Lt(arg any) types.BeMatcher
- func Lte(arg any) types.BeMatcher
- func Negative() types.BeMatcher
- func Odd() types.BeMatcher
- func Positive() types.BeMatcher
- func Zero() types.BeMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Approx ¶
Approx succeeds if actual is numerically approximately equal to the passed-in value within the specified threshold.
func ApproxZero ¶ added in v0.2.0
ApproxZero succeeds if actual is numerically approximately equal to zero Any type of int/float will work for comparison.
func DivisibleBy ¶
DivisibleBy succeeds if actual is numerically divisible by the passed-in value.
func GreaterThan ¶
GreaterThan succeeds if actual is numerically greater than the passed-in value.
func GreaterThanEqual ¶
GreaterThanEqual succeeds if actual is numerically greater than or equal to the passed-in value.
func Gt ¶
Gt is an alias for GreaterThan, succeeding if actual is numerically greater than the passed-in value.
func Gte ¶
Gte is an alias for GreaterThanEqual, succeeding if actual is numerically greater than or equal to the passed-in value.
func InRange ¶
InRange succeeds if actual is numerically within the specified range. The range is defined by the 'from' and 'until' values, and inclusivity is determined by the 'fromInclusive' and 'untilInclusive' flags.
func Integral ¶
Integral succeeds if actual is an integral float, meaning it has zero decimal places. This matcher checks if the numeric value has no fractional component.
func LessThanEqual ¶
LessThanEqual succeeds if actual is numerically less than or equal to the passed-in value.
func Lt ¶
Lt is an alias for LessThan, succeeding if actual is numerically less than the passed-in value.
func Lte ¶
Lte is an alias for LessThanEqual, succeeding if actual is numerically less than or equal to the passed-in value.
Types ¶
This section is empty.