expectIterable<T> function
void
expectIterable<T>(})
Implementation
void expectIterable<T>(
Iterable<T>? actual,
Iterable<T>? matcher, {
bool checkOrder = true,
dynamic skip,
Equality<T>? baseEquality,
}) {
expect(
actual?.length,
matcher?.length,
reason: "Not the same length",
);
final theEquality = checkOrder
? DeepCollectionEquality(baseEquality ?? DefaultEquality<T>())
: DeepCollectionEquality.unordered(baseEquality ?? DefaultEquality<T>());
var reason = "The iterables do not have the same elements";
if (checkOrder) {
reason += " in the same order";
}
expectTrue(
theEquality.equals(actual, matcher),
skip: skip,
reason: reason,
);
}