Documentation ¶
Index ¶
- func Equal[Type any](t common.T, want Type, got Type, opts ...cmp.Option)
- func Error(t common.T, err error)
- func False(t common.T, x bool)
- func GreaterThan[Type constraints.Ordered](t common.T, big Type, small Type)
- func GreaterThanOrEqual[Type constraints.Ordered](t common.T, big Type, small Type)
- func In[Type any](t common.T, want Type, slice []Type, opts ...cmp.Option)
- func LessThan[Type constraints.Ordered](t common.T, small Type, big Type)
- func LessThanOrEqual[Type constraints.Ordered](t common.T, small Type, big Type)
- func Nil(t common.T, err error)
- func NoErrors(t common.T, thunks ...(func() error))
- func NoFailures(t common.T, thunks ...(func()))
- func NotEqual[Type any](t common.T, want Type, got Type, opts ...cmp.Option)
- func NotIn[Type any](t common.T, want Type, slice []Type, opts ...cmp.Option)
- func True(t common.T, x bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal passes if want == got, otherwise immediately failing the test.
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 GreaterThan ¶
func GreaterThan[Type constraints.Ordered](t common.T, big Type, small Type)
GreaterThan passes if big > small, otherwise immediately failing the test.
func GreaterThanOrEqual ¶
func GreaterThanOrEqual[Type constraints.Ordered](t common.T, big Type, small Type)
GreaterThanOrEqual passes if big >= small, otherwise immediately failing the test.
func LessThan ¶
func LessThan[Type constraints.Ordered](t common.T, small Type, big Type)
LessThan passes if small < big, otherwise immediately failing the test.
func LessThanOrEqual ¶
func LessThanOrEqual[Type constraints.Ordered](t common.T, small Type, big Type)
LessThanOrEqual passes if small <= big, otherwise immediately failing the test.
func NoFailures ¶
NoFailures will exit the test immediately if any checks have previously failed. This includes any calls to `t.Fail` or `t.Error`, not just those from Testy.
func NotEqual ¶
NotEqual passes if want != got, otherwise immediately failing the test.
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.