termui/theme_test.go
2015-09-21 03:11:58 -04:00

32 lines
601 B
Go

package termui
import "testing"
var cmap = map[string]Attribute{
"fg": ColorWhite,
"bg": ColorDefault,
"border.fg": ColorWhite,
"label.fg": ColorGreen,
"par.fg": ColorYellow,
"par.label.bg": ColorWhite,
}
func TestLoopUpAttr(t *testing.T) {
tbl := []struct {
name string
should Attribute
}{
{"par.label.bg", ColorWhite},
{"par.label.fg", ColorGreen},
{"par.bg", ColorDefault},
{"bar.border.fg", ColorWhite},
{"bar.label.bg", ColorDefault},
}
for _, v := range tbl {
if lookUpAttr(cmap, v.name) != v.should {
t.Error(v.name)
}
}
}