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:
parent
56975bc80a
commit
9fccd721e0
@ -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{
|
||||
@ -19,8 +19,15 @@ func makeData() []Bar {
|
||||
}
|
||||
|
||||
stats[1] = Bar{
|
||||
Label: "Jul 09, 2018",
|
||||
Percent: 80,
|
||||
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,
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user