(t *testing.T)
| 472 | } |
| 473 | |
| 474 | func TestMustRenderSuccessAndPanic(t *testing.T) { |
| 475 | // Success case: MustRender should not panic when Render succeeds. |
| 476 | t.Run("success", func(t *testing.T) { |
| 477 | b := NewBox().Padding(1, 1).Style(Single) |
| 478 | _ = b.MustRender("Title", "Content") |
| 479 | }) |
| 480 | |
| 481 | // Panic case: invalid style causes Render to error, hence MustRender panics. |
| 482 | t.Run("panic", func(t *testing.T) { |
| 483 | defer func() { |
| 484 | if r := recover(); r == nil { |
| 485 | t.Fatalf("expected MustRender to panic for invalid style, but it did not") |
| 486 | } |
| 487 | }() |
| 488 | b := NewBox().Padding(1, 1).Style(BoxStyle("InvalidStyle")) |
| 489 | _ = b.MustRender("Title", "Content") |
| 490 | }) |
| 491 | } |
| 492 | |
| 493 | func TestRenderEmojiBordersHaveConsistentWidth(t *testing.T) { |
| 494 | b := NewBox().Padding(2, 1) |
nothing calls this directly
no test coverage detected