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

Function TestCommandStdin

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

Source from the content-addressed store, hash-verified

81}
82
83func TestCommandStdin(t *testing.T) {
84 const expect = "Hello you\nGoodbye me"
85 ctx := log.Testing(t)
86 stdin := bytes.NewBufferString("1 Hello to you\n2 Goodbye from me\n")
87 output, _ := shell.Command("awk", `{ print $2 " " $4 }`).Read(stdin).Call(ctx)
88 assert.For(ctx, "output").ThatString(output).Equals(expect)
89}
90
91func TestCommandCall(t *testing.T) {
92 const expect = "echo to stdout"

Callers

nothing calls this directly

Calls 6

ThatStringMethod · 0.80
ForMethod · 0.80
CallMethod · 0.65
ReadMethod · 0.65
CommandMethod · 0.65
EqualsMethod · 0.65

Tested by

no test coverage detected