started stats on fields.
This commit is contained in:
1 parent
2add8284e6
commit
37209f6779
11 files changed
+122
-11
No files matched your search
@@ -33,3 +33,20 @@ func TestAddStatsBasic(t *testing.T) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestGetFinalStats(t *testing.T) {
|
||||
s := NewStatAggregator()
|
||||
s.sumOfTheSquares = 5000
|
||||
s.sum = 200
|
||||
s.n = 10
|
||||
stats := s.getFinalStats()
|
||||
if stats.Mean != 20. {
|
||||
t.Fail()
|
||||
}
|
||||
if stats.Var != 100. {
|
||||
t.Fail()
|
||||
}
|
||||
if stats.Std != 10. {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user