test

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation ΒΆ

Overview ΒΆ

Package tests provides helpers to test the module functions.

Index ΒΆ

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 Consumer ΒΆ

func Consumer[T any](in <-chan T)

Consumer represent some kind of consumers.

func Generator ΒΆ

func Generator[T constraints.Integer](from T, to T, capacity int) <-chan T

Generator returns channel with data stream.

func Suit ΒΆ

func Suit[T any](t *testing.T, tester func(epipe chan error) ([]<-chan T, chan error))

Suit wraps to use asserts.

func Wait ΒΆ

func Wait[T any](in <-chan T) <-chan struct{}

Wait lock current goroutine until the input won't be closed.

func WaitError ΒΆ

func WaitError(ein <-chan error) <-chan error

WaitError lock current goroutine until error is in the channel or the channel won't be closed.

Types ΒΆ

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL