Documentation
¶
Overview ¶
Suite of testing-oriented commands that will trigger errors or failures if they aren't satistifed.
Index ¶
- type AssertArgs
- type BinaryComparison
- type Commands
- func (self *Commands) Compare(have any, args *BinaryComparison) error
- func (self *Commands) Contains(have any, args *BinaryComparison) error
- func (self *Commands) Empty(value any, args *AssertArgs) error
- func (self *Commands) Equal(have any, args *BinaryComparison) error
- func (self *Commands) Exists(value any, args *AssertArgs) error
- func (self *Commands) False(value any, args *AssertArgs) error
- func (self *Commands) Gt(have any, args *BinaryComparison) error
- func (self *Commands) Gte(have any, args *BinaryComparison) error
- func (self *Commands) IsArray(value any, args *AssertArgs) error
- func (self *Commands) IsBoolean(value any, args *AssertArgs) error
- func (self *Commands) IsDuration(value any, args *AssertArgs) error
- func (self *Commands) IsNumeric(value any, args *AssertArgs) error
- func (self *Commands) IsObject(value any, args *AssertArgs) error
- func (self *Commands) IsScalar(value any, args *AssertArgs) error
- func (self *Commands) IsString(value any, args *AssertArgs) error
- func (self *Commands) IsTime(value any, args *AssertArgs) error
- func (self *Commands) Lt(have any, args *BinaryComparison) error
- func (self *Commands) Lte(have any, args *BinaryComparison) error
- func (self *Commands) NotContains(have any, args *BinaryComparison) error
- func (self *Commands) NotEqual(have any, args *BinaryComparison) error
- func (self *Commands) NotNull(value any, args *AssertArgs) error
- func (self *Commands) Null(value any, args *AssertArgs) error
- func (self *Commands) True(value any, args *AssertArgs) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertArgs ¶ added in v0.8.2
type AssertArgs struct {
Message string `json:"message"`
// contains filtered or unexported fields
}
func (*AssertArgs) Error ¶ added in v0.8.2
func (self *AssertArgs) Error() string
type BinaryComparison ¶
type BinaryComparison struct {
AssertArgs
Value any `json:"value"`
Test string `json:"test"`
}
type Commands ¶
func (*Commands) Compare ¶
func (self *Commands) Compare(have any, args *BinaryComparison) error
Return an error if the given value is not equal to the other value.
func (*Commands) Contains ¶
func (self *Commands) Contains(have any, args *BinaryComparison) error
Return an error if the given value does not contain another value.
func (*Commands) Empty ¶
func (self *Commands) Empty(value any, args *AssertArgs) error
Return an error if the given value not empty.
func (*Commands) Equal ¶
func (self *Commands) Equal(have any, args *BinaryComparison) error
Return an error if the given value is not equal to the other value.
func (*Commands) Exists ¶
func (self *Commands) Exists(value any, args *AssertArgs) error
Return an error if the given value is null or zero-length.
func (*Commands) False ¶
func (self *Commands) False(value any, args *AssertArgs) error
Return an error if the given value is not false.
func (*Commands) Gt ¶
func (self *Commands) Gt(have any, args *BinaryComparison) error
Return an error if the given value is not numerically greater than the second value.
func (*Commands) Gte ¶
func (self *Commands) Gte(have any, args *BinaryComparison) error
Return an error if the given value is not numerically greater than or equal to the second value.
func (*Commands) IsArray ¶
func (self *Commands) IsArray(value any, args *AssertArgs) error
Return an error if the given value is not an array.
func (*Commands) IsBoolean ¶
func (self *Commands) IsBoolean(value any, args *AssertArgs) error
Return an error if the given value is not a boolean value.
func (*Commands) IsDuration ¶
func (self *Commands) IsDuration(value any, args *AssertArgs) error
Return an error if the given value is not parsable as a duration.
func (*Commands) IsNumeric ¶
func (self *Commands) IsNumeric(value any, args *AssertArgs) error
Return an error if the given value is not a numeric value.
func (*Commands) IsObject ¶
func (self *Commands) IsObject(value any, args *AssertArgs) error
Return an error if the given value is not an object.
func (*Commands) IsScalar ¶
func (self *Commands) IsScalar(value any, args *AssertArgs) error
Return an error if the given value is not a scalar value.
func (*Commands) IsString ¶
func (self *Commands) IsString(value any, args *AssertArgs) error
Return an error if the given value is not a string.
func (*Commands) IsTime ¶
func (self *Commands) IsTime(value any, args *AssertArgs) error
Return an error if the given value is not parsable as a time.
func (*Commands) Lt ¶
func (self *Commands) Lt(have any, args *BinaryComparison) error
Return an error if the given value is not numerically less than the second value.
func (*Commands) Lte ¶
func (self *Commands) Lte(have any, args *BinaryComparison) error
Return an error if the given value is not numerically less than or equal to the second value.
func (*Commands) NotContains ¶
func (self *Commands) NotContains(have any, args *BinaryComparison) error
Return an error if the given value contains another value.
func (*Commands) NotEqual ¶
func (self *Commands) NotEqual(have any, args *BinaryComparison) error
Return an error if the given value is equal to the other value.
func (*Commands) NotNull ¶
func (self *Commands) NotNull(value any, args *AssertArgs) error
Return an error if the given value is null.