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

Function TestPrintWithDimensions_VeryNarrowTerminal

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

Source from the content-addressed store, hash-verified

157}
158
159func 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
175func TestPrintWithDimensions_TaskWithProgress(t *testing.T) {
176 w, buf := newTestWriter()

Callers

nothing calls this directly

Calls 5

newTestWriterFunction · 0.85
addTaskFunction · 0.85
extractLinesFunction · 0.85
printWithDimensionsMethod · 0.80
lenAnsiFunction · 0.70

Tested by

no test coverage detected