MCPcopy
hub / github.com/docker/compose / TestAdjustLineWidth_DetailsRemovedWhenTooShort

Function TestAdjustLineWidth_DetailsRemovedWhenTooShort

cmd/display/tty_test.go:355–369  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

353}
354
355func 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
372func stripAnsi(s string) string {

Callers

nothing calls this directly

Calls 1

adjustLineWidthMethod · 0.95

Tested by

no test coverage detected