Documentation ¶
Overview ¶
Package test contains test utilities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIoSim ¶ added in v0.4.0
NewIoSim creates a new IO sim and returns the A and B side of an IO simulator that implements a io.ReadWriteCloser. Typically the A side would be used by your test code to read/write simulated data, and the B side would be passed to your code that uses an io.ReadWriter.
Types ¶
type Fifo ¶ added in v0.4.0
type Fifo struct {
// contains filtered or unexported fields
}
Fifo uses unix named pipes or fifos to emulate a UART type channel the A side manages the channel, creates the fifos, cleans up, etc. The B side only opens the fifos for read/write. Fifo implements the io.ReadWriteCloser interface. The Close() on the B side does not do anything.
func NewFifoA ¶ added in v0.4.0
NewFifoA creates the A side interface. This must be called first to create the fifo files.
type IoSim ¶ added in v0.4.0
type IoSim struct {
// contains filtered or unexported fields
}
IoSim is used to simulate an io channel -- provides both sides so you can easily test code that uses an io.ReadWriter interface, etc