(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestPrintWithDimensions_VeryNarrowTerminal(t *testing.T) { |
| 160 | w, buf := newTestWriter() |
| 161 | addTask(w, "Image nginx", "Pulling", "details", api.Working) |
| 162 | |
| 163 | terminalWidth := 30 |
| 164 | w.printWithDimensions(terminalWidth, 24) |
| 165 | |
| 166 | lines := extractLines(buf) |
| 167 | for i, line := range lines { |
| 168 | lineLen := lenAnsi(line) |
| 169 | assert.Assert(t, lineLen <= terminalWidth, |
| 170 | "line %d has length %d which exceeds terminal width %d: %q", |
| 171 | i, lineLen, terminalWidth, line) |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | func TestPrintWithDimensions_TaskWithProgress(t *testing.T) { |
| 176 | w, buf := newTestWriter() |
nothing calls this directly
no test coverage detected