MCPcopy Create free account
hub / github.com/Driver-C/tryssh / captureOutput

Function captureOutput

pkg/control/get_test.go:21–31  ·  view source on GitHub ↗
(f func())

Source from the content-addressed store, hash-verified

19}
20
21func captureOutput(f func()) string {
22 old := os.Stdout
23 r, w, _ := os.Pipe()
24 os.Stdout = w
25 f()
26 w.Close()
27 os.Stdout = old
28 var buf bytes.Buffer
29 buf.ReadFrom(r)
30 return buf.String()
31}
32
33func TestGetController_ExecuteGet_Users_All(t *testing.T) {
34 cfg := newTestMainConfig()

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected