MCPcopy Index your code
hub / github.com/coder/coder / NewPiped

Function NewPiped

testutil/expecter/expecter.go:88–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func NewPiped(t *testing.T) (*Expecter, io.Writer) {
89 r, w := io.Pipe()
90 e := New(t, r, "cmd")
91
92 t.Cleanup(func() {
93 // Close writer here at the end of the test to ensure we don't leak goroutines reading from the pipe.
94 _ = w.Close()
95 e.Close("test end")
96 })
97 return e, w
98}
99
100type Expecter struct {
101 t *testing.T

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
CleanupMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected