MCPcopy Create free account
hub / github.com/aws-cloudformation/rain / TestTable_WithPadding

Function TestTable_WithPadding

internal/table/table_test.go:97–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestTable_WithPadding(t *testing.T) {
98 t.Parallel()
99
100 // zero value
101 buf := bytes.Buffer{}
102 tbl := New("foo", "bar").WithWriter(&buf).WithPadding(0)
103 tbl.Print()
104 out := buf.String()
105 assert.Contains(t, out, "foobar")
106
107 // positive value
108 buf.Reset()
109 tbl.WithPadding(4).Print()
110 out = buf.String()
111 assert.Contains(t, out, "foo bar ")
112
113 // negative value
114 buf.Reset()
115 tbl.WithPadding(-1).Print()
116 out = buf.String()
117 assert.Contains(t, out, "foobar")
118}
119
120func TestTable_WithWriter(t *testing.T) {
121 t.Parallel()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.70
WithPaddingMethod · 0.65
WithWriterMethod · 0.65
PrintMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected