(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func 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 | |
| 120 | func TestTable_WithWriter(t *testing.T) { |
| 121 | t.Parallel() |
nothing calls this directly
no test coverage detected