xtesting

package
v0.0.0-...-519d24f Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTesting

func IsTesting() bool

IsTesting returns if the current process is executed by `go test` or not.

Types

type Runner

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

Runner is a struct to run a test

func NewRunner

func NewRunner(t *testing.T) *Runner

NewRunner returns a *Runner

func (*Runner) Run

func (r *Runner) Run(name string, f func(a *assert.Assert))

Run runs a test

func (*Runner) Setup

func (r *Runner) Setup(f func(a *assert.Assert))

Setup sets the function to be executed on every test execution

func (*Runner) Teardown

func (r *Runner) Teardown(f func(a *assert.Assert))

Teardown sets the function to be executed on every test execution

Directories

Path Synopsis
Package assert provides the assersion feature for *testing.T You can use assert functions by `assert.New(t)` import ( "testing" "github.com/yssk22/go/x/xtesting/assert" ) func TestSomething(t *testing.T){ assert := assert.New(t) assert.OK(true) assert.EqInt(1, 1) assert.EqStr("Expects", "Got", "Somthing wrong!") }
Package assert provides the assersion feature for *testing.T You can use assert functions by `assert.New(t)` import ( "testing" "github.com/yssk22/go/x/xtesting/assert" ) func TestSomething(t *testing.T){ assert := assert.New(t) assert.OK(true) assert.EqInt(1, 1) assert.EqStr("Expects", "Got", "Somthing wrong!") }

Jump to

Keyboard shortcuts

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