(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestMinGauges(t *testing.T) { |
| 51 | type testcase struct { |
| 52 | exp float64 |
| 53 | mf MetricFamilyMap |
| 54 | } |
| 55 | |
| 56 | for _, tc := range []testcase{ |
| 57 | {exp: math.NaN(), mf: MetricFamilyMap{}}, |
| 58 | {exp: math.NaN(), mf: MetricFamilyMap{"metric": nil}}, |
| 59 | {exp: math.NaN(), mf: MetricFamilyMap{"metric": &dto.MetricFamily{Metric: nil}}}, |
| 60 | {exp: math.NaN(), mf: MetricFamilyMap{"metric": &dto.MetricFamily{Metric: []*dto.Metric{{Gauge: &dto.Gauge{}}}}}}, |
| 61 | {exp: 12345.6789, mf: MetricFamilyMap{"metric": &dto.MetricFamily{Metric: []*dto.Metric{{Gauge: &dto.Gauge{Value: proto.Float64(12345.6789)}}}}}}, |
| 62 | {exp: 1234.56789, mf: MetricFamilyMap{"metric": &dto.MetricFamily{Metric: []*dto.Metric{ |
| 63 | {Gauge: &dto.Gauge{Value: proto.Float64(1234.56789)}}, |
| 64 | {Gauge: &dto.Gauge{Value: proto.Float64(7890.12345)}}, |
| 65 | }}}}, |
| 66 | } { |
| 67 | checkFloats(t, tc.mf.MinGauges("metric"), tc.exp) |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func TestMaxGauges(t *testing.T) { |
| 72 | type testcase struct { |
nothing calls this directly
no test coverage detected