Documentation ¶
Overview ¶
Package testutil provides test utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FatalStack ¶
FatalStack helps to fatal the test and print out the stacks of all running goroutines.
func WaitSchedule ¶
func WaitSchedule()
TODO: improve this when we are able to know the schedule or status of target go-routine.
Types ¶
type PauseableHandler ¶
func (*PauseableHandler) Pause ¶
func (ph *PauseableHandler) Pause()
func (*PauseableHandler) Resume ¶
func (ph *PauseableHandler) Resume()
func (*PauseableHandler) ServeHTTP ¶
func (ph *PauseableHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Recorder ¶
type Recorder interface { // Record publishes an Action (e.g., function call) which will // be reflected by Wait() or Chan() Record(a Action) // Wait waits until at least n Actions are availble or returns with error Wait(n int) ([]Action, error) // Action returns immediately available Actions Action() []Action // Chan returns the channel for actions published by Record Chan() <-chan Action }
func NewRecorderStream ¶
func NewRecorderStream() Recorder
type RecorderBuffered ¶
RecorderBuffered appends all Actions to a slice
func (*RecorderBuffered) Action ¶
func (r *RecorderBuffered) Action() []Action
func (*RecorderBuffered) Chan ¶
func (r *RecorderBuffered) Chan() <-chan Action
func (*RecorderBuffered) Record ¶
func (r *RecorderBuffered) Record(a Action)
Click to show internal directories.
Click to hide internal directories.