Add a mechanism to check for map arguments in the args_matcher #244
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a working implementation to fix an issue with the args_matcher. I iniitally tried in #242 but never succeeded there.
When asserting on calls to functions were the arguments are maps, the matching function returns a false positive, ie. matching on a 3 items map, even when the called function had 2.
Current issue
On
master
, the issue is in the MatchSpec that we send over toets:match_spec_run
:Changes
meck_util:match_spec_item
in the case that the some of the args to the function is a mapThis PR adds a new matching function
meck_util:match_spec_item()
that builds an erlang Match Specification in the case that any of the arguments given to the function are a map.I understand the complexity of
match_spec_item
is now way higher than it was before, opening this PR to hear your thoughts on it.