update dependencies
This commit is contained in:
parent
fce1b99683
commit
397e9c0842
164 changed files with 5207 additions and 2213 deletions
34
vendor/github.com/olekukonko/tablewriter/table_test.go
generated
vendored
34
vendor/github.com/olekukonko/tablewriter/table_test.go
generated
vendored
|
|
@ -833,3 +833,37 @@ func TestWrapString(t *testing.T) {
|
|||
t.Errorf("\ngot:\n%v\nwant:\n%v\n", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCustomAlign(t *testing.T) {
|
||||
var (
|
||||
buf = &bytes.Buffer{}
|
||||
table = NewWriter(buf)
|
||||
header = []string{"AAA", "BBB", "CCC"}
|
||||
data = [][]string{
|
||||
[]string{"a", "b", "c"},
|
||||
[]string{"1", "2", "3"},
|
||||
}
|
||||
footer = []string{"a", "b", "cccc"}
|
||||
want = `+-----+-----+-------+
|
||||
| AAA | BBB | CCC |
|
||||
+-----+-----+-------+
|
||||
| a | b | c |
|
||||
| 1 | 2 | 3 |
|
||||
+-----+-----+-------+
|
||||
| A | B | CCCC |
|
||||
+-----+-----+-------+
|
||||
`
|
||||
)
|
||||
table.SetHeader(header)
|
||||
table.SetFooter(footer)
|
||||
table.AppendBulk(data)
|
||||
table.SetColMinWidth(2, 5)
|
||||
table.SetColumnAlignment([]int{ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT})
|
||||
table.Render()
|
||||
|
||||
got := buf.String()
|
||||
|
||||
if got != want {
|
||||
t.Errorf("\ngot:\n%s\nwant:\n%s\n", got, want)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue