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

Function TestSpec_PublicAPI_MinMax

pkg/stats/spec_test.go:52–63  ·  view source on GitHub ↗

TestSpec_PublicAPI_MinMax validates that Min and Max track the extreme observed values as described in the package README.md. Specification: - Min: "Returns the minimum observed value" - Max: "Returns the maximum observed value"

(t *testing.T)

Source from the content-addressed store, hash-verified

50// - Min: "Returns the minimum observed value"
51// - Max: "Returns the maximum observed value"
52func TestSpec_PublicAPI_MinMax(t *testing.T) {
53 var sv StatVar
54 sv.Add(5.0)
55 sv.Add(1.0)
56 sv.Add(9.0)
57 sv.Add(3.0)
58
59 assert.InDelta(t, 1.0, sv.Min(), 1e-9,
60 "Min should return the smallest value ever passed to Add")
61 assert.InDelta(t, 9.0, sv.Max(), 1e-9,
62 "Max should return the largest value ever passed to Add")
63}
64
65// TestSpec_PublicAPI_Mean validates that Mean returns the arithmetic mean
66// as described in the package README.md.

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
MinMethod · 0.95
MaxMethod · 0.95

Tested by

no test coverage detected