Closed natebosch closed 1 month ago
Condition
in some places. I don't think that it makes sense to try to split between deepEquals
and deepMatches
in that case. The distinction comes down to the deep vs non-deep behavior. With the shallow "contains" check we get a bigger benefit from type inference on the condition callbacks (can allow typed Subject
arguments, instead of Subject<dynamic>
).
The joined behavior in
containsInOrder
has some usability issues:deepEquals
, but it doesn't have the same behavior for collection typed elements. Checking that a nested collection is contained in order requires aCondition
callback that uses.deepEquals
explicitly.Object?
signature throws away inference on theCondition
callback arguments. With a method that supports only conditions the argument type can be tightened and allow inference.Deprecate the old
containsInOrder
and plan to remove it before stable. This is a bit more restrictive, but it's not too noisy to fit a few(it) => it.equals(foo)
in a collection that needs mixed behavior and the collection of two methods is less confusing to document than the joined behavior.Lean on the "Matches" verb for cases that check a
Condition
callback and renamepairwiseComparesTo
aspairwiseMatches
.Fix a type check when pretty printing
Condition
callbacks. Match more thanCondition<dynamic>
by checkingCondition<Never>
.