testutil

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package testutil wraps helpers for testing.

Index

Constants

View Source
const Race = false

Race reports if the race detector is enabled.

Variables

This section is empty.

Functions

func Date added in v0.19.0

func Date() time.Time

Date return date for testing.

func MaxAlloc

func MaxAlloc(t *testing.T, n int, f func())

MaxAlloc checks that f does not allocate more than n.

func RSAPrivateKey added in v0.18.0

func RSAPrivateKey() *rsa.PrivateKey

RSAPrivateKey returns pre-generated test RSA private key.

func Rand added in v0.18.0

func Rand(seed []byte) *rand.Rand

Rand returns a new rand.Rand with source deterministically initialized from seed byte slice.

Zero length seed (or nil) is valid input.

func RequireErr

func RequireErr(t testing.TB, expected, actual error, msgAndArgs ...interface{})

RequireErr asserts that errors.Is(actual, expected) is true.

func ZeroAlloc

func ZeroAlloc(t *testing.T, f func())

ZeroAlloc checks that f does not allocate.

Types

This section is empty.

Jump to

Keyboard shortcuts

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