Documentation
¶
Overview ¶
Package testpty gives tests a stand-in for a tmux attach client's PTY. A real client's PTY stays open, its reads blocking, until the session ends; /dev/null or a regular file reads EOF at once, which a client takes for a session that died. Pair's attach end blocks until the test closes its peer, and it is pollable, so a deadline or Close interrupts a blocked read and releasing a client stays fast.
Only test code imports this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pair ¶
Pair returns a connected, bidirectional pair: attach stands in for the PTY a client reads its session's output from and writes keys to, and closing peer is what the session ending does to it (reads return EOF). attach is non-blocking, so os.NewFile registers it with the runtime poller. Both ends are closed when t finishes.
Types ¶
This section is empty.