Skip to content

Commit

Permalink
add serie_float64 test case
Browse files Browse the repository at this point in the history
  • Loading branch information
anywhy committed Aug 15, 2024
1 parent 8773c22 commit b27fc89
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/types/series_float64_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package types

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestSeriesBaseFuncWithPushData(t *testing.T) {
series := NewFloat64Series(0.5, 1.0)
series.Push(2.5)
series.Push(3.0)
series.Push(4.0)
mean := series.Mean(5)
assert.Equal(t, 2.2, mean)
stdev := series.Stdev(5)
assert.Equal(t, 1.2884098726725126, stdev)
}

0 comments on commit b27fc89

Please sign in to comment.