Skip to content

Commit

Permalink
[fmtutil/table] Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Jan 18, 2024
1 parent 65c2133 commit a5fa0d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions fmtutil/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ func setColumnsSizes(t *Table, columns int) {

if index+1 == columns {
if totalSize+(columns*3) < tableWidth {
fmt.Println(1001)
t.columnSizes[index]++
}

Expand Down
2 changes: 1 addition & 1 deletion fmtutil/table/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (s *TableSuite) TestAuxi(c *C) {

c.Assert(getColumnsNum(t), Equals, len(t.Sizes))

t = &Table{columnSizes: []int{4, 4}}
t = &Table{columnSizes: []int{4, 4}, Width: 88}
renderRowData(t, []string{"ABCDABCDABCD", "ABCDABCDABCD"}, 2)

setColumnsSizes(t, 3)
Expand Down

0 comments on commit a5fa0d3

Please sign in to comment.