(t *testing.T)
| 253 | } |
| 254 | |
| 255 | func TestCommandStdinBeforeStart(t *testing.T) { |
| 256 | ctx := context.Background() |
| 257 | cmd := New(ctx, "bash", "-c", "cat; echo -n foo") |
| 258 | |
| 259 | c := cmd.Cmd() |
| 260 | stdin, err := c.StdinPipe() |
| 261 | assert.NoError(t, err) |
| 262 | |
| 263 | _, err = stdin.Write([]byte("bar")) |
| 264 | assert.NoError(t, err) |
| 265 | |
| 266 | err = stdin.Close() |
| 267 | assert.NoError(t, err) |
| 268 | |
| 269 | stdout, _, err := cmd.RunAndGetOutput() |
| 270 | assert.NoError(t, err) |
| 271 | |
| 272 | assert.Equal(t, "barfoo", string(stdout)) |
| 273 | } |
| 274 | |
| 275 | func TestCommandStdinAfterStart(t *testing.T) { |
| 276 | ctx := context.Background() |
nothing calls this directly
no test coverage detected