MCPcopy
hub / github.com/grafana/dskit / checkFloats

Function checkFloats

metrics/tenant_registries_test.go:38–48  ·  view source on GitHub ↗
(t *testing.T, exp, val float64)

Source from the content-addressed store, hash-verified

36}
37
38func checkFloats(t *testing.T, exp, val float64) {
39 if math.IsNaN(val) {
40 if !math.IsNaN(exp) {
41 require.Fail(t, "expected %s got NaN", exp)
42 }
43 } else if math.IsNaN(exp) {
44 require.Fail(t, "expected NaN, got %s", val)
45 } else {
46 require.Equal(t, exp, val)
47 }
48}
49
50func TestMinGauges(t *testing.T) {
51 type testcase struct {

Callers 2

TestMinGaugesFunction · 0.85
TestMaxGaugesFunction · 0.85

Calls 2

FailMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected