MCPcopy Create free account
hub / github.com/google/gapid / TestCommandCaptureStdout

Function TestCommandCaptureStdout

core/os/shell/command_test.go:66–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestCommandCaptureStdout(t *testing.T) {
67 const expect = "echo to stdout\n"
68 ctx := log.Testing(t)
69 buf := &bytes.Buffer{}
70 err := shell.Command("echo", "echo to stdout").Capture(buf, nil).Run(ctx)
71 assert.For(ctx, "err").ThatError(err).Succeeded()
72 assert.For(ctx, "buf").ThatString(buf).Equals(expect)
73}
74
75func TestCommandCaptureStderr(t *testing.T) {
76 const expect = "print to stderr\n"

Callers

nothing calls this directly

Calls 8

SucceededMethod · 0.80
ThatErrorMethod · 0.80
ForMethod · 0.80
ThatStringMethod · 0.80
RunMethod · 0.65
CaptureMethod · 0.65
CommandMethod · 0.65
EqualsMethod · 0.65

Tested by

no test coverage detected