testing

package
v0.2.5-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: GPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTest

func RunTest(t *testing.T, fun TestFunction, cases ...TestCase)

func TTA

func TTA(args ...interface{}) []interface{}

func ToTestArgs

func ToTestArgs(args ...interface{}) []interface{}

Types

type MockTestFunction

type MockTestFunction func(ctrl *gomock.Controller) []interface{}

type TestCase

type TestCase struct {
	Name      string
	Args      []interface{}
	Expected  TestExpected
	InitMocks MockTestFunction
}

type TestCasesSuite

type TestCasesSuite struct {
	suite.Suite
}

func (*TestCasesSuite) RunTest

func (s *TestCasesSuite) RunTest(fun TestFunction, cases ...TestCase)

type TestErrorExpected

type TestErrorExpected struct {
	CheckError bool // mean only check error without compare
	Error      error
}

type TestExpected

type TestExpected struct {
	PanicError      *TestPanicErrorExpected
	Error           *TestErrorExpected
	ExpectedReturns []interface{}
}

func TTCEE

func TTCEE() TestExpected

func TTE

func TTE(checkError bool, err error, withPanic bool, panicMsg string,
	expedites ...interface{},
) TestExpected

func TTEE

func TTEE(err error) TestExpected

func TTPEE

func TTPEE(msg interface{}) TestExpected

func TTVE

func TTVE(expedites ...interface{}) TestExpected

func ToTestCheckErrorExpected

func ToTestCheckErrorExpected() TestExpected

func ToTestErrorExpected

func ToTestErrorExpected(err error) TestExpected

func ToTestExpected

func ToTestExpected(checkError bool, err error, withPanic bool, panicMsg interface{},
	expedites ...interface{},
) TestExpected

func ToTestPanicErrorExpected

func ToTestPanicErrorExpected(msg interface{}) TestExpected

func ToTestValuesExpected

func ToTestValuesExpected(expedites ...interface{}) TestExpected

func (*TestExpected) HaveError

func (te *TestExpected) HaveError() bool

func (*TestExpected) HavePanicError

func (te *TestExpected) HavePanicError() bool

func (*TestExpected) MustErrorExpected

func (te *TestExpected) MustErrorExpected() TestErrorExpected

func (*TestExpected) MustPanicErrorExpected

func (te *TestExpected) MustPanicErrorExpected() TestPanicErrorExpected

type TestFunction

type TestFunction func(args ...interface{}) []interface{}

type TestPanicErrorExpected

type TestPanicErrorExpected struct {
	Msg interface{}
}

Jump to

Keyboard shortcuts

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