| 364 | } |
| 365 | |
| 366 | func 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 | |
| 382 | func TestRenderWithVariousColorFormats(t *testing.T) { |
| 383 | title := "Color Formats" |