Documentation ¶
Overview ¶
Package conntest implements fakes for package conn.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Discard ¶
Discard implements conn.Conn and discards all writes and reads zeros. It never fails.
type Playback ¶
Playback implements conn.Conn and plays back a recorded I/O flow.
While "replay" type of unit tests are of limited value, they still present an easy way to do basic code coverage.
Set DontPanic to true to return an error instead of panicking, which is the default.
type Record ¶
type Record struct { sync.Mutex Conn conn.Conn // Conn can be nil if only writes are being recorded. Ops []IO }
Record implements conn.Conn that records everything written to it.
This can then be used to feed to Playback to do "replay" based unit tests.
Click to show internal directories.
Click to hide internal directories.