(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestEOFWithoutError(t *testing.T) { |
| 38 | ctx := context.TODO() |
| 39 | c, err := New(ctx, "sh", "-c", "echo hello; echo some debug log >&2; exit 0") |
| 40 | assert.NilError(t, err) |
| 41 | b := make([]byte, 32) |
| 42 | n, err := c.Read(b) |
| 43 | assert.Check(t, is.Equal(len("hello\n"), n)) |
| 44 | assert.NilError(t, err) |
| 45 | n, err = c.Read(b) |
| 46 | assert.Check(t, is.Equal(0, n)) |
| 47 | assert.Check(t, is.Equal(io.EOF, err)) |
| 48 | } |
| 49 | |
| 50 | func TestCloseRunningCommand(t *testing.T) { |
| 51 | ctx := context.TODO() |