(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func 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 | |
| 76 | type syncBuffer struct { |
| 77 | L sync.Mutex |
nothing calls this directly
no test coverage detected