Documentation
¶
Overview ¶
Package th provides basic test helpers.
Index ¶
- func DoConcurrently(ff ...func())
- func DoConcurrentlyN(n int, f func(i int))
- func ExpectDrainedChan[A any](t *testing.T, ch <-chan A)
- func ExpectError(t *testing.T, err error, message string)
- func ExpectNeverClosedChan[A any](t *testing.T, ch <-chan A, waitFor time.Duration)
- func ExpectNoError(t *testing.T, err error)
- func ExpectNotHang(t *testing.T, waitFor time.Duration, f func())
- func ExpectNotPanic(t *testing.T, f func())
- func ExpectSlice[A comparable](t *testing.T, actual []A, expected []A)
- func ExpectSorted[T ordered](t *testing.T, arr []T)
- func ExpectUnsorted[T ordered](t *testing.T, arr []T)
- func ExpectValue[A comparable](t *testing.T, actual A, expected A)
- func ExpectValueGTE[A number](t *testing.T, actual A, expected A)
- func ExpectValueInDelta[A number](t *testing.T, actual A, expected A, delta A)
- func ExpectValueLTE[A number](t *testing.T, actual A, expected A)
- func FromRange(start, end int) <-chan int
- func FromSlice[A any](slice []A) <-chan A
- func Name(args ...any) string
- func Send[T any](ch chan<- T, items ...T)
- func Sort[A ordered](s []A)
- func TestBothOrderings(t *testing.T, f func(t *testing.T, ord bool))
- func ToSlice[A any](in <-chan A) []A
- type InProgressCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoConcurrently ¶
func DoConcurrently(ff ...func())
func DoConcurrentlyN ¶
func ExpectDrainedChan ¶
func ExpectNeverClosedChan ¶
func ExpectNoError ¶
func ExpectNotPanic ¶
func ExpectSlice ¶
func ExpectSlice[A comparable](t *testing.T, actual []A, expected []A)
func ExpectSorted ¶
func ExpectUnsorted ¶
func ExpectValue ¶
func ExpectValue[A comparable](t *testing.T, actual A, expected A)
func ExpectValueGTE ¶
func ExpectValueInDelta ¶
func ExpectValueLTE ¶
Types ¶
type InProgressCounter ¶
type InProgressCounter struct {
// contains filtered or unexported fields
}
func (*InProgressCounter) Current ¶
func (c *InProgressCounter) Current() int
func (*InProgressCounter) Dec ¶
func (c *InProgressCounter) Dec()
func (*InProgressCounter) Inc ¶
func (c *InProgressCounter) Inc()
func (*InProgressCounter) Max ¶
func (c *InProgressCounter) Max() int
Click to show internal directories.
Click to hide internal directories.