errtest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2018 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPanicError

func NewPanicError(msg string) error

NewPanicError returns a new error that is identifiable as a panic error.

func Run

func Run(t *testing.T, config *Config, f func(s *Simulation) error)

Run runs simulations by repeatedly calling s until all possible scenarios of a simulation are covered.

Types

type Config

type Config struct {
	IgnorePanicOrder    bool
	RequireCloseOnPanic bool

	SkipErrors bool // call Skip on testing.T for any error it encounters.
}

A Config is used to configure a simulation.

var (
	Pedantic *Config = &Config{
		RequireCloseOnPanic: true,
	}

	Relaxed *Config = &Config{
		IgnorePanicOrder: true,
	}

	SkipErrors *Config = &Config{
		SkipErrors: true,
	}
)

These Config values are some common values

type Option

type Option func(*options)

An Option configures a simulation.

func IgnoreError

func IgnoreError() Option

func NoClose

func NoClose() Option

func NoError

func NoError() Option

func NoPanic

func NoPanic() Option

type Simulation

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

func (*Simulation) Close

func (s *Simulation) Close(key string, opts ...Option) error

func (*Simulation) CloseWithError

func (s *Simulation) CloseWithError(key string, err error, opts ...Option) error

func (*Simulation) Fatalf

func (s *Simulation) Fatalf(format string, args ...interface{})

func (*Simulation) Open

func (s *Simulation) Open(key string, opts ...Option) error

Jump to

Keyboard shortcuts

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