Documentation ¶
Index ¶
- func Equal[Type any](t common.T, want Type, got Type, opts ...cmp.Option) bool
- func Error(t common.T, err error) bool
- func False(t common.T, x bool) bool
- func GreaterThan[Type constraints.Ordered](t common.T, big Type, small Type) bool
- func GreaterThanOrEqual[Type constraints.Ordered](t common.T, big Type, small Type) bool
- func In[Type any](t common.T, element Type, slice []Type, opts ...cmp.Option) bool
- func LessThan[Type constraints.Ordered](t common.T, small Type, big Type) bool
- func LessThanOrEqual[Type constraints.Ordered](t common.T, small Type, big Type) bool
- func Nil(t common.T, err error) bool
- func NotEqual[Type any](t common.T, want Type, got Type, opts ...cmp.Option) bool
- func NotIn[Type any](t common.T, element Type, slice []Type, opts ...cmp.Option) bool
- func True(t common.T, x bool) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal returns true if want == got, otherwise marks the test as failed and returns false.
This is a typesafe check for inequality using go-cmp, allowing arguments only of the same type to be compared. Most of the time, this is the equality-checking method that you want.
You can change the behavior of the equality checking using the go-cmp/cmp Options system. For more information, see [the go-cmp documentation](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal).
func Error ¶
Error returns true if err != nil, otherwise marks the test as failed and returns false.
func False ¶
False returns true if x == false, otherwise marks the test as failed and returns false.
func GreaterThan ¶
func GreaterThan[Type constraints.Ordered](t common.T, big Type, small Type) bool
GreaterThan returns true if big > small, otherwise marks the test as failed and returns false.
func GreaterThanOrEqual ¶
func GreaterThanOrEqual[Type constraints.Ordered](t common.T, big Type, small Type) bool
GreaterThanOrEqual returns true if big >= small, otherwise marks the test as failed and returns false.
func In ¶
In returns true if element is in slice, otherwise marks the test as failed and returns false.
func LessThan ¶
func LessThan[Type constraints.Ordered](t common.T, small Type, big Type) bool
LessThan returns true if small < big, otherwise marks the test as failed and returns false.
func LessThanOrEqual ¶
func LessThanOrEqual[Type constraints.Ordered](t common.T, small Type, big Type) bool
LessThanOrEqual returns true if small <= big, otherwise marks the test as failed and returns false.
func NotEqual ¶
NotEqual returns true if want != got, otherwise marks the test as failed and returns false.
This is a typesafe check for inequality using go-cmp, allowing arguments only of the same type to be compared. Most of the time, this is the inequality-checking method that you want.
You can change the behavior of the equality checking using the go-cmp/cmp Options system. For more information, see [the go-cmp documentation](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal).
Types ¶
This section is empty.