1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Expand and fix test

Add an extra color
Fix empty case. This shows up as white/whatever color the rest of the widget is like
This commit is contained in:
Sean Smith 2019-09-13 19:22:20 -04:00
parent 56975bc80a
commit 9fccd721e0

View File

@ -10,7 +10,7 @@ import (
func makeData() []Bar {
//this could come from config
const lineCount = 2
const lineCount = 3
var stats [lineCount]Bar
stats[0] = Bar{
@ -21,6 +21,13 @@ func makeData() []Bar {
stats[1] = Bar{
Label: "Jul 09, 2018",
Percent: 80,
LabelColor: "red",
}
stats[2] = Bar{
Label: "Jul 09, 2018",
Percent: 80,
LabelColor: "green",
}
return stats[:]
@ -33,7 +40,7 @@ func TestOutput(t *testing.T) {
result := BuildStars(makeData(), 20, "*")
Equal(t,
"Jun 27, 2018[[red]****[white] ] 20\nJul 09, 2018[[red]****************[white] ] 80\n",
"Jun 27, 2018[[]****[white] ] 20\nJul 09, 2018[[red]****************[white] ] 80\nJul 09, 2018[[green]****************[white] ] 80\n",
result,
)
}