MCPcopy Create free account
hub / github.com/github/gh-aw / TestSpec_PublicAPI_Mean

Function TestSpec_PublicAPI_Mean

pkg/stats/spec_test.go:69–77  ·  view source on GitHub ↗

TestSpec_PublicAPI_Mean validates that Mean returns the arithmetic mean as described in the package README.md. Specification: "Mean: Returns the arithmetic mean"

(t *testing.T)

Source from the content-addressed store, hash-verified

67//
68// Specification: "Mean: Returns the arithmetic mean"
69func TestSpec_PublicAPI_Mean(t *testing.T) {
70 var sv StatVar
71 sv.Add(2.0)
72 sv.Add(4.0)
73 sv.Add(6.0)
74
75 assert.InDelta(t, 4.0, sv.Mean(), 1e-9,
76 "Mean should equal (sum of observations) / count")
77}
78
79// TestSpec_PublicAPI_SampleVariance_SampleFormula validates that SampleVariance
80// uses the sample formula with N-1 as the denominator as described in the README.md.

Callers

nothing calls this directly

Calls 2

AddMethod · 0.95
MeanMethod · 0.95

Tested by

no test coverage detected