(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestStatVar_TwoObservations(t *testing.T) { |
| 37 | var s StatVar |
| 38 | s.Add(10.0) |
| 39 | s.Add(20.0) |
| 40 | |
| 41 | assert.Equal(t, 2, s.Count(), "two: count should be 2") |
| 42 | assert.InDelta(t, 10.0, s.Min(), 1e-9, "two: min should be 10") |
| 43 | assert.InDelta(t, 20.0, s.Max(), 1e-9, "two: max should be 20") |
| 44 | assert.InDelta(t, 15.0, s.Mean(), 1e-9, "two: mean should be 15") |
| 45 | // Sample variance: 50 / (2-1) = 50 |
| 46 | assert.InDelta(t, 50.0, s.SampleVariance(), 1e-9, "two: sample variance should be 50") |
| 47 | assert.InDelta(t, math.Sqrt(50), s.SampleStdDev(), 1e-9, "two: sample stddev should be sqrt(50)") |
| 48 | // Median of [10, 20] → (10+20)/2 = 15 |
| 49 | assert.InDelta(t, 15.0, s.Median(), 1e-9, "two: median should be 15") |
| 50 | } |
| 51 | |
| 52 | func TestStatVar_OddCount(t *testing.T) { |
| 53 | var s StatVar |
nothing calls this directly
no test coverage detected