-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add containsMatchingInOrder containsEqualInOrder (#2284)
The joined behavior in `containsInOrder` has some usability issues: - It mimics the arguments for `deepEquals`, but it doesn't have the same behavior for collection typed elements. Checking that a nested collection is contained in order requires a `Condition` callback that uses `.deepEquals` explicitly. - The `Object?` signature throws away inference on the `Condition` 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 rename `pairwiseComparesTo` as `pairwiseMatches`. Fix a type check when pretty printing `Condition` callbacks. Match more than `Condition<dynamic>` by checking `Condition<Never>`.
- Loading branch information
Showing
5 changed files
with
165 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters