with

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concurrency added in v1.3.0

func Concurrency(tb testing.TB, f func(ctx context.Context, harness *ConcurrencyHarness))

creates a harness that should be used for running concurrent tests; these are tests that start long-running goroutines that need supervision the test function will run inside this function, and following the test running a synchronized shutdown of the supervised SUT will take place, followed by an assertion that no unexpected errors have been logged

func Context added in v1.3.0

func Context(f func(ctx context.Context))

func Logging

func Logging(tb testing.TB, f func(harness *LoggingHarness))

func RequireNoUnexpectedErrors

func RequireNoUnexpectedErrors(f Fataler, errorTracker ErrorTracker)

Types

type ConcurrencyHarness added in v1.3.0

type ConcurrencyHarness struct {
	govnr.TreeSupervisor
	Logger log.Logger

	T testing.TB
	// contains filtered or unexported fields
}

func (*ConcurrencyHarness) AllowErrorsMatching added in v1.3.0

func (h *ConcurrencyHarness) AllowErrorsMatching(pattern string)

type ErrorTracker

type ErrorTracker interface {
	HasErrors() bool
}

type Fataler

type Fataler interface {
	Fatal(args ...interface{})
}

type LoggingHarness

type LoggingHarness struct {
	Logger log.Logger

	T testing.TB
	// contains filtered or unexported fields
}

func (*LoggingHarness) AllowErrorsMatching

func (h *LoggingHarness) AllowErrorsMatching(pattern string)

Jump to

Keyboard shortcuts

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