mirror of
				https://github.com/taigrr/wtf
				synced 2025-01-18 04:03:14 -08:00 
			
		
		
		
	added unit test
This commit is contained in:
		
						commit
						1bac334a8a
					
				| @ -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[:]) |  | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -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) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user