Documentation
¶
Index ¶
- func Default[V comparable](c *config, v V)
- func Equal[V comparable](c *config, a, b V)
- func Err(c *config, err error)
- func NewRelaxed(t T) *config
- func NilPointer[V any](c *config, v *V)
- func Not(c *config) *config
- func Panic(c *config, f func())
- func SliceContains[S ~[]I, I comparable](c *config, s S, v I)
- func SliceEmpty[S ~[]I, I any](c *config, s S)
- func SliceEqual[S1 ~[]I, S2 ~[]I, I comparable](c *config, s1 S1, s2 S2)
- func True(c *config, ok bool)
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Default ¶
func Default[V comparable](c *config, v V)
Assert that the given value is the default value for the given type.
func Equal ¶
func Equal[V comparable](c *config, a, b V)
Assert that the two given comparable values are equal.
Use SliceEqual to compare slices.
func NewRelaxed ¶
func NewRelaxed(t T) *config
NewRelaxed creates tinytest config that does not stop test execution on failed assertions.
A version of this function that does stop the execution will be provided in later releases.
func SliceContains ¶
func SliceContains[S ~[]I, I comparable](c *config, s S, v I)
Assert that the given slice contains the given element.
func SliceEmpty ¶
func SliceEmpty[S ~[]I, I any](c *config, s S)
Assert that the given slice is empty
func SliceEqual ¶
func SliceEqual[S1 ~[]I, S2 ~[]I, I comparable](c *config, s1 S1, s2 S2)
Assert that the given slices are equal (the smae length and the same elements).
Types ¶
type T ¶
type T interface { // Fail marks the test as failed but continues execution. Fail() // FailNow marks the test as failed and immediately interrupts execution. FailNow() // True if the test is already marked as failed. Failed() bool // Helper marks a function as a helper function. // // Helper functions are not included in tracebacks. Helper() // Logf is like [fmt.Sprintf] and used in tests for error messages and traces. Logf(format string, args ...any) }
T is the current test state manager.
Click to show internal directories.
Click to hide internal directories.