Documentation ¶
Overview ¶
Package testutil provides utilities for use in tests.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorAfter ¶
ErrorAfter will return an error after the provided timeout has passed if the provided WaitGroup has not unblocked. All Add() calls to the WaitGroup must be performed before calling this function.
func ErrorAfterFunc ¶
ErrorAfterFunc will return an error after the provided timeout has passed if the provided function has not returned.
func FatalAfter ¶
FatalAfter will fatal the test after the provided timeout has passed if the provided WaitGroup has not unblocked. All Add() calls to the WaitGroup must be performed before calling this function.
func FatalAfterFunc ¶
FatalAfterFunc will fatal the test after the provided timeout has passed if the provided function has not returned.
Example (Fatal) ¶
var t testing.T // This test will fatal FatalAfterFunc(&t, 10*time.Millisecond, func() { time.Sleep(1 * time.Millisecond) })
Output:
Example (Success) ¶
var t testing.T // This test will pass FatalAfterFunc(&t, 10*time.Millisecond, func() { time.Sleep(1 * time.Millisecond) })
Output:
Types ¶
This section is empty.