Documentation
¶
Index ¶
- Constants
- func CheckIntegerEqual[T1 Integer, T2 Integer](t *testing.T, expected T1, actual T2)
- func CheckIntegerGreater[T1 Integer, T2 Integer](t *testing.T, expected T1, actual T2)
- func CheckIntegerGreaterOrEqual[T1 Integer, T2 Integer](t *testing.T, expected T1, actual T2)
- func CheckIntegerLess[T1 Integer, T2 Integer](t *testing.T, expected T1, actual T2)
- func CheckIntegerLessOrEqual[T1 Integer, T2 Integer](t *testing.T, expected T1, actual T2)
- func CheckIntegerNotEqual[T1 Integer, T2 Integer](t *testing.T, expected T1, actual T2)
- func CheckStringByStringMatch(t *testing.T, pattern string, actual string, options ...any)
- func CheckStringCompare(t *testing.T, expected string, actual string, fn StringCompareFunc, ...)
- func CheckStringEqual(t *testing.T, expected string, actual string, options ...any)
- func CheckStringEqualAny(t *testing.T, expecteds []string, actual string, options ...any)
- func CheckStringEqualChomped(t *testing.T, expected string, actual string, options ...any)
- func CheckStringEqualIgnoreCase(t *testing.T, expected string, actual string, options ...any)
- func CheckStringEqualTrimmed(t *testing.T, expected string, actual string, options ...any)
- func CheckStringNotEqual(t *testing.T, expected string, actual string, options ...any)
- func CheckStringNotEqualChomped(t *testing.T, expected string, actual string, options ...any)
- func CheckStringNotEqualIgnoreCase(t *testing.T, expected string, actual string, options ...any)
- func CheckStringNotEqualTrimmed(t *testing.T, expected string, actual string, options ...any)
- func IsFalse[T bool | BooleanConvertible | Predicate | PredicateWithFailureMessage](t *testing.T, value T)
- func IsTrue[T bool | BooleanConvertible | Predicate | PredicateWithFailureMessage](t *testing.T, value T)
- func Version() uint64
- func VersionString() string
- type BooleanConvertible
- type CheckStringFlag
- type Integer
- type IntegerConvertible
- type Predicate
- type PredicateWithFailureMessage
- type SignedInteger
- type SignedIntegerConvertible
- type StringCompareFunc
- type UnsignedInteger
- type UnsignedIntegerConvertible
Constants ¶
const ( VersionMajor uint16 = 0 VersionMinor uint16 = 4 VersionPatch uint16 = 1 VersionAB uint16 = ver2go.Release )
const (
CheckStringFlag_None = 1 << iota
)
Variables ¶
This section is empty.
Functions ¶
func CheckIntegerEqual ¶ added in v0.3.0
Evaluates two integers, of arbitrary type, for equality comparison, calling testing.T.Errorf() if the evaluation fails.
func CheckIntegerGreater ¶ added in v0.3.0
Evaluates two integers, of arbitrary type, for greater-than comparison, calling testing.T.Errorf() if the evaluation fails.
func CheckIntegerGreaterOrEqual ¶ added in v0.3.0
Evaluates two integers, of arbitrary type, for greater-than-or-equal comparison, calling testing.T.Errorf() if the evaluation fails.
func CheckIntegerLess ¶ added in v0.3.0
Evaluates two integers, of arbitrary type, for less-than comparison, calling testing.T.Errorf() if the evaluation fails.
func CheckIntegerLessOrEqual ¶ added in v0.3.0
Evaluates two integers, of arbitrary type, for less-than-or-equal comparison, calling testing.T.Errorf() if the evaluation fails.
func CheckIntegerNotEqual ¶ added in v0.3.0
Evaluates two integers, of arbitrary type, for inequality comparison, calling testing.T.Errorf() if the evaluation fails.
func CheckStringByStringMatch ¶
Evaluates a string against a regular expression, calling testing.T.Error() if it does not.
func CheckStringCompare ¶
func CheckStringCompare( t *testing.T, expected string, actual string, fn StringCompareFunc, comparison_type string, options ...any, )
Evaluates two strings, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by the given caller-supplied comparison function, whose brief descriptor comparison_type, e.g. "regular expression" will be prefixed with the string "when compared by ".
func CheckStringEqual ¶
Evaluates two strings for equality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison.
func CheckStringEqualAny ¶
Evaluates a string for equality against an array of string values, calling testing.T.Errorf() if every evaluation fails. Each evaluation is done by equality comparison.
func CheckStringEqualChomped ¶ added in v0.2.0
Evaluates two strings for equality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison after chomping the actual value.
func CheckStringEqualIgnoreCase ¶
Evaluates two strings for equality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison ignoring the case of the strings, via the strings.EqualFold() standard library function.
func CheckStringEqualTrimmed ¶
Evaluates two strings for equality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison after whitespace-trimming the actual value.
func CheckStringNotEqual ¶ added in v0.2.0
Evaluates two strings for inequality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison.
func CheckStringNotEqualChomped ¶ added in v0.2.0
Evaluates two strings for inequality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison after chomping the actual value.
func CheckStringNotEqualIgnoreCase ¶ added in v0.2.0
Evaluates two strings for inequality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison ignoring the case of the strings, via the strings.EqualFold() standard library function.
func CheckStringNotEqualTrimmed ¶ added in v0.2.0
Evaluates two strings for inequality, calling testing.T.Errorf() if the evaluation fails. The evaluation is done by equality comparison after whitespace-trimming the actual value.
func IsFalse ¶ added in v0.3.0
func IsFalse[T bool | BooleanConvertible | Predicate | PredicateWithFailureMessage](t *testing.T, value T)
Evaluates a boolean value or predicate to obtain a boolean value, calling testing.T.Errorf() if the value is not false.
func IsTrue ¶ added in v0.3.0
func IsTrue[T bool | BooleanConvertible | Predicate | PredicateWithFailureMessage](t *testing.T, value T)
Evaluates a boolean value or predicate to obtain a boolean value, calling testing.T.Errorf() if the value is not true.
func Version ¶
func Version() uint64
Version returns this library's version as a packed 64-bit integer, formed by ver2go.CombineVersion from VersionMajor, VersionMinor, VersionPatch, and VersionAB. The result is suitable for numeric comparison: a later release has a strictly greater value than an earlier one that uses the same packing.
func VersionString ¶ added in v0.2.2
func VersionString() string
VersionString returns this library's version as a human-readable string, formed by ver2go.CalcVersionString from VersionMajor, VersionMinor, VersionPatch, and VersionAB. For a final (non-prerelease) version the result is of the form "MAJOR.MINOR.PATCH", e.g. "0.4.1".
Types ¶
type BooleanConvertible ¶ added in v0.3.0
type BooleanConvertible interface {
~bool
}
type CheckStringFlag ¶
type CheckStringFlag int
type Integer ¶ added in v0.3.0
type Integer interface {
SignedInteger | UnsignedInteger
}
type IntegerConvertible ¶ added in v0.3.0
type IntegerConvertible interface {
SignedIntegerConvertible | UnsignedIntegerConvertible
}