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

Function TestRenderNegativePadding

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

Source from the content-addressed store, hash-verified

336}
337
338func TestRenderNegativePadding(t *testing.T) {
339 // Horizontal padding < 0.
340 b := NewBox().Padding(-1, 1).Style(Single)
341 if _, err := b.Render("Title", "Content"); err == nil {
342 t.Fatalf("expected error for negative horizontal padding, got nil")
343 } else if !strings.Contains(err.Error(), "horizontal padding cannot be negative") {
344 t.Errorf("unexpected error for negative horizontal padding: %v", err)
345 }
346
347 // Vertical padding < 0.
348 b = NewBox().Padding(1, -1).Style(Single)
349 if _, err := b.Render("Title", "Content"); err == nil {
350 t.Fatalf("expected error for negative vertical padding, got nil")
351 } else if !strings.Contains(err.Error(), "vertical padding cannot be negative") {
352 t.Errorf("unexpected error for negative vertical padding: %v", err)
353 }
354}
355
356func TestRenderInvalidContentAlign(t *testing.T) {
357 b := NewBox().Padding(1, 1).Style(Single).ContentAlign(AlignType("Weird"))

Callers

nothing calls this directly

Calls 4

NewBoxFunction · 0.85
StyleMethod · 0.80
PaddingMethod · 0.80
RenderMethod · 0.80

Tested by

no test coverage detected