MCPcopy
hub / github.com/mum4k/termdash / newTestTab

Function newTestTab

widgets/tab/tab_test.go:271–282  ·  view source on GitHub ↗

newTestTab returns a small tab with valid widget content.

(t *testing.T, name string)

Source from the content-addressed store, hash-verified

269
270// newTestTab returns a small tab with valid widget content.
271func newTestTab(t *testing.T, name string) *Tab {
272 t.Helper()
273
274 w, err := text.New(text.WrapAtWords())
275 if err != nil {
276 t.Fatalf("text.New() => unexpected error: %v", err)
277 }
278 if err := w.Write(name); err != nil {
279 t.Fatalf("Write() => unexpected error: %v", err)
280 }
281 return &Tab{Name: name, Content: container.PlaceWidget(w)}
282}

Calls 4

NewFunction · 0.92
WrapAtWordsFunction · 0.92
PlaceWidgetFunction · 0.92
WriteMethod · 0.45

Tested by

no test coverage detected