Documentation
¶
Overview ¶
Package termiotest provides *termio.Streams test helpers with buffer- backed streams and convenience accessors for the underlying buffers.
Quick start ¶
s, in, out, errOut := termiotest.New() fmt.Fprintln(s.Out, "hello") fmt.Println(out.String()) // prints "hello\n"
Both New and NewTTY return the three *bytes.Buffer values corresponding to In, Out, and ErrOut so assertions are one line:
assert.Equal(t, "hello\n", out.String())
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a *termio.Streams backed by three *bytes.Buffer values. All three streams report as non-TTY. The returned buffers are the live underlying storage; writes to s.Out appear in out, etc.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.