(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestRenderNonTTYLWrapContent(t *testing.T) { |
| 325 | oldIsTTY := isTTY |
| 326 | defer func() { isTTY = oldIsTTY }() // restore after test |
| 327 | |
| 328 | isTTY = func(fd uintptr) bool { return false } // mock as non-TTY |
| 329 | b := NewBox().Padding(1, 1).Style(Single).WrapContent(true) |
| 330 | |
| 331 | if _, err := b.Render("Title", "Content"); err == nil { |
| 332 | t.Fatalf("expected error for non TTY output with wrapping enabled, got nil") |
| 333 | } else if !strings.Contains(err.Error(), "cannot determine terminal width") { |
| 334 | t.Errorf("unexpected error message for non TTY wrap content: %v", err) |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | func TestRenderNegativePadding(t *testing.T) { |
| 339 | // Horizontal padding < 0. |
nothing calls this directly
no test coverage detected