expectMap<K, V> function
void
expectMap<K, V>(})
Expect that actual has the same length as matcher and
that they have the same entries, as per keyEquality and
valueEquality.
Implementation
void expectMap<K, V>(
Map<K, V>? actual,
Map<K, V>? matcher, {
dynamic skip, // true or a String
Equality<K>? keyEquality,
Equality<V>? valueEquality,
}) {
expect(
actual?.length,
matcher?.length,
reason: "Not the same length",
);
final theEquality = MapEquality<K, V>(
keys: keyEquality ?? DefaultEquality<K>(),
values: valueEquality ?? DefaultEquality<V>(),
);
expectTrue(
theEquality.equals(actual, matcher),
skip: skip,
reason: "The maps do not have the same entries.",
);
}