Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common misconception about equals not being applied to maps #217

Closed
gilvan-reis opened this issue Jan 24, 2024 · 1 comment · Fixed by #218
Closed

Common misconception about equals not being applied to maps #217

gilvan-reis opened this issue Jan 24, 2024 · 1 comment · Fixed by #218
Assignees

Comments

@gilvan-reis
Copy link
Member

gilvan-reis commented Jan 24, 2024

Context

It is a common misconception from users that the default matcher for map is embeds. We already had another issue that improved the documentation, but this problem continues to happen very often.

In my team, we are creating several replicated functions to do deep-equals (following this README section) to validate nested maps.

This discussion already started in a message in the #matcher-combinator slack channel.

Proposed Solution

Create the deep-equals function in the matcher-combinators.matchers namespace with a proper docstring trying to bring this explanation closer to the code.

(defn deep-equals [expected]
  (match-with [map? m/equals]
              expected))
@gilvan-reis
Copy link
Member Author

Closed by #218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant