MCPcopy Create free account
hub / github.com/facebook/time / fakePort

Struct fakePort

sa53/protocol/protocol_test.go:82–90  ·  view source on GitHub ↗

fakePort is a scripted SerialReadWriter for tests. Each Read call returns the next chunk in chunks; SetReadTimeout is recorded.

Source from the content-addressed store, hash-verified

80// fakePort is a scripted SerialReadWriter for tests. Each Read call returns
81// the next chunk in chunks; SetReadTimeout is recorded.
82type fakePort struct {
83 chunks [][]byte
84 idx int
85 written []byte
86 timeout time.Duration
87 // timeoutSequence captures every SetReadTimeout call so tests can
88 // assert ordering (e.g. drain installs short then restores).
89 timeoutSequence []time.Duration
90}
91
92func (f *fakePort) Read(b []byte) (int, error) {
93 if f.idx >= len(f.chunks) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected