equals function

Matcher equals (dynamic expected, [ int limit = 100 ])

Returns a matcher that matches if the value is structurally equal to expected.

If expected is a Matcher, then it matches using that. Otherwise it tests for equality using == on the expected value.

For Iterables and Maps, this will recursively match the elements. To handle cyclic structures a recursion depth limit can be provided. The default limit is 100. Sets will be compared order-independently.


Matcher equals(expected, [int limit = 100]) => expected is String
    ? new _StringEqualsMatcher(expected)
    : new _DeepMatcher(expected, limit);