Documentation ¶
Overview ¶
Package testutil wraps helpers for testing.
Index ¶
- Constants
- func Date() time.Time
- func ErrWriter(err error) io.Writer
- func MaxAlloc(t *testing.T, n int, f func())
- func Payloads() []int
- func RSAPrivateKey() *rsa.PrivateKey
- func Rand(seed []byte) *rand.Rand
- func RunPayloads(b *testing.B, runner func(size int) func(b *testing.B))
- func SetEnv(t *testing.T, k, v string)
- func SkipExternal(tb testing.TB)
- func TestError() error
- func ZeroAlloc(t *testing.T, f func())
- type ZeroRand
Constants ¶
const Race = false
Race reports if the race detector is enabled.
Variables ¶
This section is empty.
Functions ¶
func Payloads ¶
func Payloads() []int
Payloads returns a payload sizes list. Helpful for benchmarks.
func RSAPrivateKey ¶
func RSAPrivateKey() *rsa.PrivateKey
RSAPrivateKey returns pre-generated test RSA private key.
func Rand ¶
Rand returns a new rand.Rand with source deterministically initialized from seed byte slice.
Zero length seed (or nil) is valid input.
func RunPayloads ¶
RunPayloads runs given benchmark runner for every payload.
func SetEnv ¶
SetEnv sets environment variable and sets delete callback to unset variable after test.
func SkipExternal ¶
SkipExternal skips current test if GOTD_TEST_EXTERNAL is not 1.
Caller should be high-level test function with TestExternalE2E prefix, like TestExternalE2EConnect.
Run all tests with following command in module root:
GOTD_TEST_EXTERNAL=1 go test -v -run ^TestExternalE2E ./...