(t *testing.T)
| 353 | } |
| 354 | |
| 355 | func TestAdjustLineWidth_DetailsRemovedWhenTooShort(t *testing.T) { |
| 356 | w := &ttyWriter{} |
| 357 | lines := []lineData{ |
| 358 | { |
| 359 | taskID: "Image foo", |
| 360 | status: "Pulling", |
| 361 | details: "abc", // Very short, can't be meaningfully truncated |
| 362 | }, |
| 363 | } |
| 364 | |
| 365 | // Terminal so narrow that even minimal details + "..." wouldn't help |
| 366 | w.adjustLineWidth(lines, 5, 28) |
| 367 | |
| 368 | assert.Equal(t, "", lines[0].details, "details should be removed entirely when too short to truncate") |
| 369 | } |
| 370 | |
| 371 | // stripAnsi removes ANSI escape codes from a string |
| 372 | func stripAnsi(s string) string { |
nothing calls this directly
no test coverage detected