Documentation ΒΆ
Overview ΒΆ
Package tests provides helpers to test the module functions.
Index ΒΆ
- func Assert[T constraints.Ordered](name string, in <-chan T, ein chan error, stmt func(data T) error) (<-chan T, chan error)
- func AssertBool[T constraints.Ordered](name string, in <-chan T, ein chan error, validator func(data T) bool) (<-chan T, chan error)
- func AssertCount[T constraints.Ordered](name string, in <-chan T, ein chan error, count int) (<-chan T, chan error)
- func AssertOrderAsc[T constraints.Ordered](name string, in <-chan T, ein chan error) (<-chan T, chan error)
- func Consumer[T any](in <-chan T)
- func Generator[T constraints.Integer](from T, to T, capacity int) <-chan T
- func Suit[T any](t *testing.T, tester func(epipe chan error) ([]<-chan T, chan error))
- func Wait[T any](in <-chan T) <-chan struct{}
- func WaitError(ein <-chan error) <-chan error
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
func Assert ΒΆ
func Assert[T constraints.Ordered](name string, in <-chan T, ein chan error, stmt func(data T) error) (<-chan T, chan error)
Assert checks statement for every item.
func AssertBool ΒΆ
func AssertBool[T constraints.Ordered](name string, in <-chan T, ein chan error, validator func(data T) bool) (<-chan T, chan error)
AssertBool checks if every item meets validation function.
func AssertCount ΒΆ
func AssertCount[T constraints.Ordered](name string, in <-chan T, ein chan error, count int) (<-chan T, chan error)
AssertCount after the input closes checks if count of total elements passed through the input if equal the value.
func AssertOrderAsc ΒΆ
func AssertOrderAsc[T constraints.Ordered](name string, in <-chan T, ein chan error) (<-chan T, chan error)
AssertOrderAsc checks if every item in ascending order.
func Generator ΒΆ
func Generator[T constraints.Integer](from T, to T, capacity int) <-chan T
Generator returns channel with data stream.
Types ΒΆ
This section is empty.
Click to show internal directories.
Click to hide internal directories.