Skip to content

Commit

Permalink
adds test cast for olekukonko#214
Browse files Browse the repository at this point in the history
  • Loading branch information
eryx committed Apr 15, 2023
1 parent 8532778 commit c41d317
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,32 @@ func TestMoreFooterColumnsThanHeaders(t *testing.T) {
checkEqual(t, buf.String(), want)
}

func TestLessFooterColumnsThanHeaders(t *testing.T) {
var (
buf = &bytes.Buffer{}
table = NewWriter(buf)
header = []string{"A", "B", "C"}
data = [][]string{
{"1", "2", "3"},
}
footer = []string{"a", "b"}
want = `+---+---+---+
| A | B | C |
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
| A | B | |
+---+---+---+
`
)
table.SetHeader(header)
table.SetFooter(footer)
table.AppendBulk(data)
table.Render()

checkEqual(t, buf.String(), want)
}

func TestSetColMinWidth(t *testing.T) {
var (
buf = &bytes.Buffer{}
Expand Down

0 comments on commit c41d317

Please sign in to comment.