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

Function TestAdjustLineWidth_NoTruncationNeeded

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

Source from the content-addressed store, hash-verified

334}
335
336func TestAdjustLineWidth_NoTruncationNeeded(t *testing.T) {
337 w := &ttyWriter{}
338 originalDetails := "short"
339 originalTaskID := "Image foo"
340 lines := []lineData{
341 {
342 taskID: originalTaskID,
343 status: "Pulling",
344 details: originalDetails,
345 },
346 }
347
348 // Wide terminal, nothing should be truncated
349 w.adjustLineWidth(lines, 5, 100)
350
351 assert.Equal(t, originalTaskID, lines[0].taskID, "taskID should not be modified")
352 assert.Equal(t, originalDetails, lines[0].details, "details should not be modified")
353}
354
355func TestAdjustLineWidth_DetailsRemovedWhenTooShort(t *testing.T) {
356 w := &ttyWriter{}

Callers

nothing calls this directly

Calls 1

adjustLineWidthMethod · 0.95

Tested by

no test coverage detected