(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestIsTerminal(t *testing.T) { |
| 11 | // easy way to get a reader and a writer |
| 12 | r, w, err := os.Pipe() |
| 13 | require.NoError(t, err) |
| 14 | |
| 15 | require.False(t, isTerminal(r)) |
| 16 | require.False(t, isTerminal(w)) |
| 17 | |
| 18 | // golang's testing framework replaces os.Stdin and os.Stdout, so the following doesn't work here |
| 19 | // require.True(t, isTerminal(os.Stdin)) |
| 20 | // require.True(t, isTerminal(os.Stdout)) |
| 21 | } |
nothing calls this directly
no test coverage detected