MCPcopy
hub / github.com/jesseduffield/lazygit / TestWithPadding

Function TestWithPadding

pkg/utils/formatting_test.go:11–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestWithPadding(t *testing.T) {
12 type scenario struct {
13 str string
14 padding int
15 alignment Alignment
16 expected string
17 }
18
19 scenarios := []scenario{
20 {
21 str: "hello world !",
22 padding: 1,
23 alignment: AlignLeft,
24 expected: "hello world !",
25 },
26 {
27 str: "hello world !",
28 padding: 14,
29 alignment: AlignLeft,
30 expected: "hello world ! ",
31 },
32 {
33 str: "hello world !",
34 padding: 14,
35 alignment: AlignRight,
36 expected: " hello world !",
37 },
38 {
39 str: "Güçlü",
40 padding: 7,
41 alignment: AlignLeft,
42 expected: "Güçlü ",
43 },
44 {
45 str: "Güçlü",
46 padding: 7,
47 alignment: AlignRight,
48 expected: " Güçlü",
49 },
50 }
51
52 for _, s := range scenarios {
53 assert.EqualValues(t, s.expected, WithPadding(s.str, s.padding, s.alignment))
54 }
55}
56
57func TestGetPadWidths(t *testing.T) {
58 type scenario struct {

Callers

nothing calls this directly

Calls 1

WithPaddingFunction · 0.85

Tested by

no test coverage detected