MCPcopy Create free account
hub / github.com/Shopify/goose / TestCommandRunWait

Function TestCommandRunWait

shell/shell_test.go:63–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

61}
62
63func TestCommandRunWait(t *testing.T) {
64 ctx := context.Background()
65 cmd := New(ctx, "bash", "-c", "echo -n foo; echo -n bar >&2")
66 c := cmd.Cmd()
67 stdout, stderr, err := cmd.RunAndGetOutput()
68
69 assert.NoError(t, err)
70 assert.True(t, c.ProcessState.Success())
71 assert.True(t, c.ProcessState.Exited())
72 assert.Equal(t, []byte("foo"), stdout)
73 assert.Equal(t, []byte("bar"), stderr)
74}
75
76type syncBuffer struct {
77 L sync.Mutex

Callers

nothing calls this directly

Calls 3

NewFunction · 0.70
CmdMethod · 0.65
RunAndGetOutputMethod · 0.65

Tested by

no test coverage detected