(expected, actual model.SamplePair, tolerance float64)
| 195 | } |
| 196 | |
| 197 | func compareSamplePair(expected, actual model.SamplePair, tolerance float64) error { |
| 198 | if expected.Timestamp != actual.Timestamp { |
| 199 | return fmt.Errorf("expected timestamp %v but got %v", expected.Timestamp, actual.Timestamp) |
| 200 | } |
| 201 | if !compareSampleValue(expected.Value, actual.Value, tolerance) { |
| 202 | return fmt.Errorf("expected value %s for timestamp %v but got %s", expected.Value, expected.Timestamp, actual.Value) |
| 203 | } |
| 204 | |
| 205 | return nil |
| 206 | } |
| 207 | |
| 208 | func compareSampleValue(first, second model.SampleValue, tolerance float64) bool { |
| 209 | f := float64(first) |
no test coverage detected