MCPcopy Index your code
hub / github.com/box-cli-maker/box-cli-maker / TestRenderWithWrapLimit

Function TestRenderWithWrapLimit

box_render_test.go:366–380  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

364}
365
366func TestRenderWithWrapLimit(t *testing.T) {
367 longContent := strings.Repeat("word ", 20)
368 b := NewBox().Padding(2, 0).Style(Single).Color(Green).WrapContent(true).WrapLimit(10)
369
370 out, err := b.Render("Wrapped", longContent)
371 if err != nil {
372 t.Fatalf("Render with wrapping returned error: %v", err)
373 }
374 if !strings.Contains(out, "Wrapped") {
375 t.Errorf("expected title to appear in wrapped box output")
376 }
377 if !strings.Contains(out, "word") {
378 t.Errorf("expected content to appear in wrapped box output")
379 }
380}
381
382func TestRenderWithVariousColorFormats(t *testing.T) {
383 title := "Color Formats"

Callers

nothing calls this directly

Calls 7

NewBoxFunction · 0.85
WrapLimitMethod · 0.80
WrapContentMethod · 0.80
ColorMethod · 0.80
StyleMethod · 0.80
PaddingMethod · 0.80
RenderMethod · 0.80

Tested by

no test coverage detected