MCPcopy
hub / github.com/prometheus/prometheus / requireEntries

Function requireEntries

model/textparse/interface_test.go:210–228  ·  view source on GitHub ↗
(t *testing.T, exp, got []parsedEntry)

Source from the content-addressed store, hash-verified

208}
209
210func requireEntries(t *testing.T, exp, got []parsedEntry) {
211 t.Helper()
212
213 testutil.RequireEqualWithOptions(t, exp, got, []cmp.Option{
214 // We reuse slices so we sometimes have empty vs nil differences
215 // we need to ignore with cmpopts.EquateEmpty().
216 // However we have to filter out labels, as only
217 // one comparer per type has to be specified,
218 // and RequireEqualWithOptions uses
219 // cmp.Comparer(labels.Equal).
220 cmp.FilterValues(func(x, y any) bool {
221 _, xIsLabels := x.(labels.Labels)
222 _, yIsLabels := y.(labels.Labels)
223 return !xIsLabels && !yIsLabels
224 }, cmpopts.EquateEmpty()),
225 cmpopts.EquateNaNs(),
226 cmp.AllowUnexported(parsedEntry{}),
227 })
228}
229
230func testParse(t *testing.T, p Parser) (ret []parsedEntry) {
231 t.Helper()

Callers 12

TestPromParseFunction · 0.85
TestUTF8PromParseFunction · 0.85
TestNHCBParserOnOMParserFunction · 0.85
TestOpenMetricsParseFunction · 0.85
TestSTParseFailuresFunction · 0.85
TestProtobufParseFunction · 0.85

Calls 1

RequireEqualWithOptionsFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…