tester

package
v0.0.683 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTests = errors.New("no tests")

Functions

This section is empty.

Types

type JSONResultHandler added in v0.0.514

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

func MakeJSONResultHandler

func MakeJSONResultHandler(opts ResultHandlerOptions) JSONResultHandler

func (JSONResultHandler) HandleResults added in v0.0.514

func (jrh JSONResultHandler) HandleResults(c <-chan Result) bool

type JUnitResultHandler added in v0.0.514

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

func MakeJUnitResultHandler added in v0.0.514

func MakeJUnitResultHandler(opts ResultHandlerOptions) JUnitResultHandler

func (JUnitResultHandler) HandleResults added in v0.0.514

func (rh JUnitResultHandler) HandleResults(c <-chan Result) bool

type NamedTest

type NamedTest struct {
	Name string
	*Test
}

type ParentTestContext

type ParentTestContext struct {
	Name               string
	Input              any
	Meta               any
	Decision           any
	Compile            bool
	PipelineParameters map[string]any
}

type Result

type Result struct {
	Group  string
	Name   string
	Passed bool
	Err    error

	Elapsed time.Duration

	Ctx any
}

func (Result) MarshalJSON

func (r Result) MarshalJSON() ([]byte, error)

type ResultHandler

type ResultHandler interface {
	HandleResults(c <-chan Result) (success bool)
}

type ResultHandlerOptions

type ResultHandlerOptions struct {
	Verbose bool
	Debug   bool
	Dst     io.Writer
}

type Runner

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

func NewRunner

func NewRunner(opts RunnerOptions) (*Runner, error)

func (*Runner) Run

func (runner *Runner) Run() <-chan Result

func (*Runner) RunAndHandleResults

func (runner *Runner) RunAndHandleResults(handler ResultHandler) bool

type RunnerOptions

type RunnerOptions struct {
	Path    string
	Include *regexp.Regexp
	Compile func([]byte, map[string]any) ([]byte, error)
}

type StandardResultHandler added in v0.0.514

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

func MakeDefaultResultHandler

func MakeDefaultResultHandler(opts ResultHandlerOptions) StandardResultHandler

func (StandardResultHandler) HandleResults added in v0.0.514

func (rh StandardResultHandler) HandleResults(c <-chan Result) bool

type Test

type Test struct {
	Input              any
	Meta               any
	Decision           any
	Compile            *bool
	PipelineParameters map[string]any `yaml:"pipeline_parameters"`
	Cases              map[string]*Test
}

func (Test) NamedCases

func (t Test) NamedCases() []NamedTest

Jump to

Keyboard shortcuts

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