forked from scylladb/termtables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrow_test.go
More file actions
29 lines (23 loc) · 825 Bytes
/
row_test.go
File metadata and controls
29 lines (23 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2012-2015 Apcera Inc. All rights reserved.
package termtables
import (
"testing"
)
func TestBasicRowRender(t *testing.T) {
row := CreateRow([]interface{}{"foo", "bar"})
style := &renderStyle{TableStyle: TableStyle{BorderX: "-", BorderY: "|", BorderI: "+",
PaddingLeft: 1, PaddingRight: 1}, cellWidths: map[int]int{0: 3, 1: 3}}
output := row.Render(style)
if output != "| foo | bar |" {
t.Fatal("Unexpected output:", output)
}
}
func TestRowRenderWidthBasedPadding(t *testing.T) {
row := CreateRow([]interface{}{"foo", "bar"})
style := &renderStyle{TableStyle: TableStyle{BorderX: "-", BorderY: "|", BorderI: "+",
PaddingLeft: 1, PaddingRight: 1}, cellWidths: map[int]int{0: 3, 1: 5}}
output := row.Render(style)
if output != "| foo | bar |" {
t.Fatal("Unexpected output:", output)
}
}