Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Middleware ¶
type Middleware = func(f TestFunction) TestFunction
Middleware is a filter/wrap function add common behaviors to test function.
func BeforeAfterFP ¶
func BeforeAfterFP(before func(), after func()) Middleware
BeforeAfterFP FP version of BeforeAfter
func CloserFP ¶
func CloserFP(fClosable func() io.Closer) Middleware
CloserFP FP version of Closer().
type TestFunction ¶
TestFunction function to run by testing.T.Run()
func After ¶
func After(after func(), f TestFunction) TestFunction
After run after function after test function, even if panic
func Before ¶
func Before(before func(), f TestFunction) TestFunction
Before wraps a testing.Run() function that runs before function before test.
func BeforeAfter ¶
func BeforeAfter(before func(), after func(), f TestFunction) TestFunction
BeforeAfter run before after function before/after test function, after function called even test function paniced.
func Closer ¶
func Closer(fClosable func() io.Closer, f TestFunction) TestFunction
Closer use Closer interface to do BeforeAfter.
Put before operation in closable function, put after operation in returned Closer.Close() method.