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

added unit test

This commit is contained in:
Bill Keenan 2018-06-27 14:20:58 -04:00
commit 1bac334a8a
2 changed files with 3 additions and 4 deletions

View File

@ -50,8 +50,7 @@ func MakeGraph(widget *Widget) {
} }
icon := wtf.Config.UString("wtf.mods.bargraph.graphIcon", "✭ ") widget.BarGraph.BuildBars(stats[:])
widget.BarGraph.BuildBars(20, icon, stats[:])
} }

View File

@ -144,7 +144,7 @@ func BuildStars(data [][2]int64, maxStars int, starChar string) string {
} }
// each number = how many stars? // each number = how many stars?
var starRatio = float64(maxStars) / float64((maxValue - minValue)) var starRatio = float64(widget.maxStars) / float64((maxValue - minValue))
//build the stars //build the stars
for i := range data { for i := range data {
@ -157,7 +157,7 @@ func BuildStars(data [][2]int64, maxStars int, starChar string) string {
starCount = 1 starCount = 1
} }
//build the actual string //build the actual string
var stars = strings.Repeat(starChar, starCount) var stars = strings.Repeat(widget.starChar, starCount)
//parse the time //parse the time
var t = time.Unix(int64(data[i][1]/1000), 0) var t = time.Unix(int64(data[i][1]/1000), 0)