mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 11:30:28 +00:00
24 lines
407 B
Go
24 lines
407 B
Go
package count
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/usefathom/fathom/pkg/models"
|
|
)
|
|
|
|
func TestCalculatePointPercentages(t *testing.T) {
|
|
totals := []*models.Total{
|
|
&models.Total{
|
|
Value: "Foo",
|
|
Count: 5,
|
|
},
|
|
}
|
|
|
|
totals = calculatePercentagesOfTotal(totals, 100)
|
|
|
|
if totals[0].PercentageOfTotal != 5.00 {
|
|
t.Errorf("Percentage value should be 5.00, is %.2f", totals[0].PercentageOfTotal)
|
|
}
|
|
}
|