testing

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunFn

type RunFn func(t *T)

RunFn performs a single iteration of the test. It may be used for asserting results or failing the test.

type ScenarioFn added in v1.0.21

type ScenarioFn func(t *T) RunFn

ScenarioFn initialises a scenario and returns the iteration function (RunFn) to be invoked for every iteration of the tests.

type T

type T struct {
	// "iteration " + iteration number or "setup"
	Iteration string
	// Logger with user and iteration tags
	Log *log.Logger

	Require  *require.Assertions
	Scenario string
	// contains filtered or unexported fields
}

func NewT

func NewT(iter, scenarioName string) (*T, func())

func (*T) Cleanup added in v1.0.21

func (t *T) Cleanup(f func())

Cleanup registers a teardown function to be called when T has completed

func (*T) Errorf

func (t *T) Errorf(format string, args ...interface{})

func (*T) Fail

func (t *T) Fail()

func (*T) FailNow

func (t *T) FailNow()

func (*T) FailWithError added in v1.0.17

func (t *T) FailWithError(err error)

func (*T) HasFailed

func (t *T) HasFailed() bool

func (*T) Time

func (t *T) Time(stageName string, f func())

Time records a metric for the duration of the given function

Jump to

Keyboard shortcuts

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