diff --git a/pkg/types/series_float64_test.go b/pkg/types/series_float64_test.go new file mode 100644 index 000000000..270cd92f8 --- /dev/null +++ b/pkg/types/series_float64_test.go @@ -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) +}