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

Function TestStatVar_EvenCount

pkg/stats/statvar_test.go:66–79  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestStatVar_EvenCount(t *testing.T) {
67 var s StatVar
68 // [2, 4, 6, 8] — even number of values
69 for _, v := range []float64{8, 2, 6, 4} {
70 s.Add(v)
71 }
72
73 assert.Equal(t, 4, s.Count(), "even: count should be 4")
74 assert.InDelta(t, 2.0, s.Min(), 1e-9, "even: min should be 2")
75 assert.InDelta(t, 8.0, s.Max(), 1e-9, "even: max should be 8")
76 assert.InDelta(t, 5.0, s.Mean(), 1e-9, "even: mean should be 5")
77 // Median of [2,4,6,8] → (4+6)/2 = 5
78 assert.InDelta(t, 5.0, s.Median(), 1e-9, "even: median of [2,4,6,8] should be 5")
79}
80
81func TestStatVar_KnownVariance(t *testing.T) {
82 // Dataset: [2, 4, 4, 4, 5, 5, 7, 9]

Callers

nothing calls this directly

Calls 6

AddMethod · 0.95
CountMethod · 0.95
MinMethod · 0.95
MaxMethod · 0.95
MeanMethod · 0.95
MedianMethod · 0.95

Tested by

no test coverage detected