more rigorous test.
This commit is contained in:
parent
cedf89e17c
commit
dd7970910e
1 changed files with 7 additions and 0 deletions
|
@ -85,7 +85,14 @@ func TestMovingAverageSeriesGetLastValue(t *testing.T) {
|
|||
WindowSize: 10,
|
||||
}
|
||||
|
||||
var yvalues []float64
|
||||
for x := 0; x < mas.Len(); x++ {
|
||||
_, y := mas.GetValue(x)
|
||||
yvalues = append(yvalues, y)
|
||||
}
|
||||
|
||||
lx, ly := mas.GetLastValue()
|
||||
assert.Equal(100.0, lx)
|
||||
assert.Equal(5.5, ly)
|
||||
assert.Equal(yvalues[len(yvalues)-1], ly)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue