(t *testing.T, exp, got []parsedEntry)
| 208 | } |
| 209 | |
| 210 | func 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 | |
| 230 | func testParse(t *testing.T, p Parser) (ret []parsedEntry) { |
| 231 | t.Helper() |
no test coverage detected
searching dependent graphs…