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 {
|
func makeData() []Bar {
|
||||||
|
|
||||||
//this could come from config
|
//this could come from config
|
||||||
const lineCount = 2
|
const lineCount = 3
|
||||||
var stats [lineCount]Bar
|
var stats [lineCount]Bar
|
||||||
|
|
||||||
stats[0] = Bar{
|
stats[0] = Bar{
|
||||||
@ -21,6 +21,13 @@ func makeData() []Bar {
|
|||||||
stats[1] = Bar{
|
stats[1] = Bar{
|
||||||
Label: "Jul 09, 2018",
|
Label: "Jul 09, 2018",
|
||||||
Percent: 80,
|
Percent: 80,
|
||||||
|
LabelColor: "red",
|
||||||
|
}
|
||||||
|
|
||||||
|
stats[2] = Bar{
|
||||||
|
Label: "Jul 09, 2018",
|
||||||
|
Percent: 80,
|
||||||
|
LabelColor: "green",
|
||||||
}
|
}
|
||||||
|
|
||||||
return stats[:]
|
return stats[:]
|
||||||
@ -33,7 +40,7 @@ func TestOutput(t *testing.T) {
|
|||||||
result := BuildStars(makeData(), 20, "*")
|
result := BuildStars(makeData(), 20, "*")
|
||||||
|
|
||||||
Equal(t,
|
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,
|
result,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user