-
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.
Special case maps with only value keys (#2257)
Closes #2256 When checking deep equality on Map instances (including maps nested in other collection types) we allow keys which are instances of other collection (and don't have a useful `operator ==`) and keys which are `Condition` callbacks that could potentially match multiple keys of the actual value. This is maximally flexible, but it loses the nested path information we are otherwise able to keep for iterables compared by index. Check whether expectation maps have any keys which need this special treatment, and if not, special case to an algorithm close to the `Iterable` algorithm which can enqueue nested checks and maintain the direct known path into the collection. Update the doc comment to describe the new behavior. This does potentially introduce confusion since a change which adds a `Condition` key has to potential to make _other_ keys in the same expectation behaved differently. The benefit is a more actionable failure output for the much more common case of checking expectations with hardcoded keys.
- Loading branch information
Showing
3 changed files
with
144 additions
and
66 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