283
expectedEventsAttributes []map[string]any,
284
actualHistoryEvents []*historypb.HistoryEvent,
286
>
if th, ok := h.t.(helper); ok {
287
>
th.Helper()
288
>
}
289
290
>
actualHistoryEvents = h.sanitizeActualHistoryEventsForContains(expectedHistoryEvents, actualHistoryEvents)
history_require.go
291
>
292
>
expectedCompactHistory := h.formatHistoryEvents(expectedHistoryEvents, true)
293
>
actualCompactHistory := h.formatHistoryEvents(actualHistoryEvents, true)
294
>
295
>
startPos := strings.Index(actualCompactHistory, expectedCompactHistory)
296
>
require.GreaterOrEqual(h.t, startPos, 0, "Expected history is not found in actual history. Expected:\n%s\nActual:\n%s", expectedCompactHistory, actualCompactHistory)
297
>
actualHistoryEventsFirstIndex := strings.Count(actualCompactHistory[:startPos], "\n")
298
>
299
>
h.equalHistoryEventsAttributes(expectedEventsAttributes, actualHistoryEvents[actualHistoryEventsFirstIndex:])
300
}
301