TestSpec_PublicAPI_StdDev validates that StdDev and SampleStdDev equal the square root of their respective variances as described in the README.md. Specification: - StdDev: "Returns population standard deviation" - SampleStdDev: "Returns sample standard deviation"
(t *testing.T)
| 100 | // - StdDev: "Returns population standard deviation" |
| 101 | // - SampleStdDev: "Returns sample standard deviation" |
| 102 | func TestSpec_PublicAPI_StdDev(t *testing.T) { |
| 103 | var sv StatVar |
| 104 | for _, v := range []float64{2, 4, 4, 4, 5, 5, 7, 9} { |
| 105 | sv.Add(v) |
| 106 | } |
| 107 | |
| 108 | assert.InDelta(t, math.Sqrt(sv.SampleVariance()), sv.SampleStdDev(), 1e-9, |
| 109 | "SampleStdDev should equal sqrt(SampleVariance)") |
| 110 | } |
| 111 | |
| 112 | // TestSpec_PublicAPI_Median_OddCount validates that Median returns the middle |
| 113 | // value for an odd-count set as described in the README.md. |
nothing calls this directly
no test coverage detected