Documentation ¶
Index ¶
- Constants
- func Assert(t testingTB, cond bool, val ...interface{})
- func Assertf(t testingTB, cond bool, format string, val ...interface{})
- func DeepEqual(t testingTB, a, b interface{})
- func GetLocalAddress() string
- func IsAddressInUse(address string) bool
- func Panic(t testingTB, fn func())
- func PanicAt(t testingTB, fn func(), expect func(err interface{}) bool)
- func WaitServerStart(addr string)
Constants ¶
View Source
const ( UnixUserPortStart = 1023 UnixUserPortEnd = 49151 )
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
func Assert(t testingTB, cond bool, val ...interface{})
Assert asserts cond is true, otherwise fails the test.
func DeepEqual ¶
func DeepEqual(t testingTB, a, b interface{})
DeepEqual asserts a and b are deep equal, otherwise fails the test.
func GetLocalAddress ¶ added in v0.8.0
func GetLocalAddress() string
GetLocalAddress return a local address starting from 1024 This API ensures no repeated addr returned in one UNIX OS
func IsAddressInUse ¶ added in v0.8.0
tells if a net address is already in use.
func Panic ¶
func Panic(t testingTB, fn func())
Panic asserts fn should panic and recover it, otherwise fails the test.
func PanicAt ¶
func PanicAt(t testingTB, fn func(), expect func(err interface{}) bool)
PanicAt asserts fn should panic and recover it, otherwise fails the test. The expect function can be provided to do further examination of the error.
func WaitServerStart ¶ added in v0.9.0
func WaitServerStart(addr string)
WaitServerStart waits for server to start for at most 1 second
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.