Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFreePorts ¶ added in v1.9.0
GetFreePorts returns a number of free local port for the tests to listen on. Note this will make sure the returned ports do not overlap, by stopping to listen once all ports are allocated
Types ¶
type CapturedOutput ¶
type CapturedOutput struct {
// contains filtered or unexported fields
}
func CaptureOutput ¶
func CaptureOutput(t *testing.T) *CapturedOutput
CaptureOutput replaces os.Stdout and os.Stderr with new pipes, that will write output to buffers. Buffers are accessible by calling Done on returned struct.
os.Stdout and os.Stderr must be reverted to previous values manually.
func (*CapturedOutput) Done ¶
func (co *CapturedOutput) Done() (stdout string, stderr string)
Done waits until all captured output has been written to buffers, and then returns the buffers.
Click to show internal directories.
Click to hide internal directories.