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

Function TestAddVertPadding

util_test.go:12–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestAddVertPadding(t *testing.T) {
13 b := &Box{vertical: "|"}
14 b.py = 2
15
16 // innerWidth is the visible width between the vertical borders.
17 got, err := b.addVertPadding(4)
18 if err != nil {
19 t.Fatalf("addVertPadding unexpected error: %v", err)
20 }
21 if len(got) != 2 {
22 t.Fatalf("expected 2 padding lines, got %d", len(got))
23 }
24
25 want := "| |" // len-2 = 4 spaces
26 for i, line := range got {
27 if line != want {
28 t.Errorf("line %d: expected %q, got %q", i, want, line)
29 }
30 }
31}
32
33func TestLongestLineBasicAndTabs(t *testing.T) {
34 lines := []string{"short", "longer"}

Callers

nothing calls this directly

Calls 1

addVertPaddingMethod · 0.95

Tested by

no test coverage detected