Documentation
¶
Overview ¶
Package xtesting contains utilities for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Benchmark ¶
func Benchmark( b *testing.B, setup func(context.Context) error, pre func(context.Context) error, fn func(context.Context) error, post func(context.Context) error, )
Benchmark benchmarks fn.
It calls the setup function once before the first iteration of the benchmark.
The pre and post functions before and after each iteration of the benchmark, respectively.
Only the time spent in fn is measured.
func ContextForCleanup ¶
ContextForCleanup returns a context with a short timeout that can be used to cleanup after a test ends.
It can be called at any time during the test (including within a cleanup function). The returned context will be cancelled 3 seconds after the test ends.
func SequentialName ¶
SequentialName returns a unique name with the given prefix.
func UniqueName ¶
UniqueName returns a unique name with the given prefix.
Types ¶
This section is empty.