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

Function TestCommandCaptureStderr

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

Source from the content-addressed store, hash-verified

73}
74
75func TestCommandCaptureStderr(t *testing.T) {
76 const expect = "print to stderr\n"
77 ctx := log.Testing(t)
78 buf := &bytes.Buffer{}
79 shell.Command("awk", `END {print "print to stderr" > "/dev/stderr"}`).Capture(nil, buf).Run(ctx)
80 assert.For(ctx, "buf").ThatString(buf).Equals(expect)
81}
82
83func TestCommandStdin(t *testing.T) {
84 const expect = "Hello you\nGoodbye me"

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected