(t *testing.T)
| 120 | } |
| 121 | |
| 122 | func TestManualBorderOverridesAfterStyle(t *testing.T) { |
| 123 | b := NewBox(). |
| 124 | Style(Double). |
| 125 | TopLeft("*"). |
| 126 | TopRight("*"). |
| 127 | BottomLeft("*"). |
| 128 | BottomRight("*") |
| 129 | |
| 130 | out, err := b.Render("Title", "Content") |
| 131 | if err != nil { |
| 132 | t.Fatalf("Render returned error: %v", err) |
| 133 | } |
| 134 | lines := strings.Split(out, "\n") |
| 135 | if len(lines) < 3 { |
| 136 | t.Fatalf("expected at least 3 lines in rendered box, got %d", len(lines)) |
| 137 | } |
| 138 | top := lines[0] |
| 139 | bottom := lines[len(lines)-2] |
| 140 | |
| 141 | if !strings.HasPrefix(top, "*") || !strings.HasSuffix(top, "*") { |
| 142 | t.Errorf("expected custom top corners '*', got %q", top) |
| 143 | } |
| 144 | if !strings.HasPrefix(bottom, "*") || !strings.HasSuffix(bottom, "*") { |
| 145 | t.Errorf("expected custom bottom corners '*', got %q", bottom) |
| 146 | } |
| 147 | |
| 148 | if !strings.Contains(top, "═") || !strings.Contains(bottom, "═") { |
| 149 | t.Errorf("expected Double style horizontal borders '═', got top=%q bottom=%q", top, bottom) |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | func TestBoxCopy(t *testing.T) { |
| 154 | t.Run("independent copies", func(t *testing.T) { |
nothing calls this directly
no test coverage detected