INNER CODE UNIT · Dart
_MatcherEquality
felangel/mocktail · packages/mocktail/lib/src/_is_invocation.dart:79
class _MatcherEquality extends DeepCollectionEquality {
const _MatcherEquality();
@override
bool equals(dynamic e1, dynamic e2) {
// All argument matches are wrapped in `ArgMatcher`, so we have to unwrap
// them into the raw `Matcher` type in order to finish our equality checks.
if (e1 is ArgMatcher) {
e1 = e1.matcher;
}
if (e2 is ArgMatcher) {
e2 = e2.matcher;
}
if (e1 is Matcher && e2 is! Matcher) {
return e1.matches(e2, <dynamic, dynamic>{});
}
if (e2 is Matcher && e1 is! Matcher) {
return e2.matches(e1, <dynamic, dynamic>{});