Documentation ¶
Index ¶
- Variables
- func AssertErrs(d error, ds ...error)
- func Check(args ...bool)
- func CostWith(fn func()) (dur time.Duration)
- func Count(n int) <-chan int
- func InErrs(d error, ds ...error) (b bool)
- func Log() *log.Logger
- func Mock(args ...interface{})
- func MockRegister(fns ...interface{})
- func Range(min, max int) int
- func RangeBytes(min, max int) []byte
- func RangeDur(min, max time.Duration) time.Duration
- func RangeString(min, max int) string
- func SliceOf(args ...interface{}) []interface{}
- func TestFuncWith(fn interface{}) *xtest
- func Tick(args ...interface{}) <-chan time.Time
- func TimeoutWith(dur time.Duration, fn func()) error
- func Try(fn func()) (e error)
- func Wrap(fn interface{}) func(...interface{}) func(...interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrXTest = func(err ...string) error { if len(err) == 0 { return errors.New("xtest error") } return fmt.Errorf("xtest error: %s", err[0]) } ErrParamIsNil = ErrXTest("the parameter is nil") ErrFuncTimeout = ErrXTest("the func is timeout") ErrParamTypeNotFunc = ErrXTest("the type of the parameters is not func") ErrDurZero = ErrXTest("duration time must more than zero") )
Functions ¶
func TestFuncWith ¶
func TestFuncWith(fn interface{}) *xtest
func TimeoutWith ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.