testops

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: MIT Imports: 2 Imported by: 0

README

testops

A framework for organizing tests as a series of operations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, envs []Env, tcs []TestCase)

Run runs all combinations of environments and test cases.

Types

type DumpOp

type DumpOp struct {
	Name string
	V    interface{}
}

DumpOp is a simple operation that logs a value.

func (DumpOp) Do

func (op DumpOp) Do(t *testing.T, v interface{})

Do is the interface function of Op.

type Env

type Env struct {
	Name string
	Func func(TestCase) (func(*testing.T), error)
}

Env is the environment an operation is executed in. It prepares and tears down the state of the test case.

type Op

type Op interface {
	Do(*testing.T, interface{})
}

Op is a single operation.

type TestCase

type TestCase struct {
	Name string
	Ops  []Op
}

TestCase is a named series of operations.

func (TestCase) Runner

func (tc TestCase) Runner(v interface{}) func(*testing.T)

Runner returns a function that performs the operations in order. The parameter is passed in as state.

Jump to

Keyboard shortcuts

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