Documentation ¶
Overview ¶
/ Package quicktest implements assertion and other helpers wrapped around the standard library's testing types. package quicktest
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert checks that the provided argument passes the given check and calls tb.Error otherwise, including any Comment arguments in the failure.
Types ¶
type Checker ¶
type Checker[T any] interface { // Check checks that the provided argument passes the check. // On failure, the returned error is printed along with // the checker arguments (obtained by calling ArgNames and Args) // and key-value pairs added by calling the note function. // // If Check returns ErrSilent, neither the checker arguments nor // the error are printed; values with note are still printed. Check(got T, note func(key string, value interface{})) error // ArgNames returns the arguments passed to the checker. ArgNames() []string // Args returns the arguments corresponding to ArgNames. Args() []interface{} }
Checker is implemented by types used as part of Check/Assert invocations. The type parameter will be the type of the first argument passed to Check or Assert.
func DeepEquals ¶
func Equals ¶
func Equals[T comparable](want T) Checker[T]
Equals checks that the argument is equal to want.
Click to show internal directories.
Click to hide internal directories.