assertEventTypeSequence checks that the provided event types match expected.
(t *testing.T, got []event.Event, expected ...event.Event)
| 1258 | |
| 1259 | // assertEventTypeSequence checks that the provided event types match expected. |
| 1260 | func assertEventTypeSequence(t *testing.T, got []event.Event, expected ...event.Event) { |
| 1261 | t.Helper() |
| 1262 | match := len(expected) == len(got) |
| 1263 | if match { |
| 1264 | for i, ge := range got { |
| 1265 | exp := expected[i] |
| 1266 | match = match && reflect.TypeOf(ge) == reflect.TypeOf(exp) |
| 1267 | } |
| 1268 | } |
| 1269 | if !match { |
| 1270 | t.Errorf("expected event types %s, got %s", eventTypesToString(expected), eventTypesToString(got)) |
| 1271 | } |
| 1272 | } |
| 1273 | |
| 1274 | func eventTypesToString(evs []event.Event) string { |
| 1275 | var s []string |
no test coverage detected
searching dependent graphs…