mint

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRng

func NewRng(seed int64) *rand.Rand

func RngSeed

func RngSeed() int64

Types

type T

type T struct {
	T *testing.T
	*assert.Assertions
	// contains filtered or unexported fields
}

T wraps the testing, assert, and quick packages in order to provide some unified functionality.

func New

func New(t *testing.T) *T

New returns a new T for testing.

func NewWith

func NewWith(t *testing.T, w Wrap) *T

NewWith returns a new T with custom test wrapper for testing.

func (*T) Failed

func (t *T) Failed() bool

func (*T) Fatal

func (t *T) Fatal(v ...interface{})

func (*T) FatalOnError

func (t *T) FatalOnError(err error, msgAndArgs ...interface{})

func (*T) Log

func (t *T) Log(vs ...interface{})

func (*T) Logf

func (t *T) Logf(fmt string, vs ...interface{})

func (*T) QuickCheck

func (t *T) QuickCheck(fns ...interface{})

QuickCheck runs a quick/check test. The last function passed specifies the test to be run. The test function can accept any parameters, but must return a bool value. The arguments are generated by random. Custom typed generator function of type `func(*rand.Rand) T` can be passed before the function under test. A generator with return value T will be used for every argument of type T. By default the random number generators seed is based on the current timestamp. Use the TEST_SEED environment value to configure a static seed value to be used by every test. The random number generator is not shared between tests.

func (*T) Run

func (t *T) Run(name string, fn func(t *T)) bool

func (*T) SetDefaultGenerators

func (t *T) SetDefaultGenerators(fns ...interface{})

SetDefaultGenerators sets default generators for use with QuickCheck.

func (*T) Skip

func (t *T) Skip(args ...interface{})

type TestLogTracer

type TestLogTracer struct {
	// contains filtered or unexported fields
}

func NewTestLogTracer

func NewTestLogTracer(loggers ...interface{}) *TestLogTracer

func (*TestLogTracer) Printf

func (t *TestLogTracer) Printf(fmt string, vs ...interface{})

func (*TestLogTracer) Println

func (t *TestLogTracer) Println(vs ...interface{})

type Wrap

type Wrap func(*T) func()

Wrap function will be called before sub-tests are run. The wrapper function must return a 'teardown' function.

Jump to

Keyboard shortcuts

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