-
Notifications
You must be signed in to change notification settings - Fork 19
add remove-unchanged API #42
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but there's some cleanup needed, I think.
If you wanted to add some property-based/generative testing, you could add a test that verifies that, for any data structure, diffing it against itself and then applying remove-unchanged
returns an empty structure.
Thanks @alysbrooks so much. I can not make this property test pass until now.
@plexus @alysbrooks |
What do the failing cases look like? |
|
The problem is not in (let [s #{false 5}]
(ddiff/diff s s))
;; => #{{:- 5} false {:+ 5}} |
A little surprised that bug hasn't been discovered before. Maybe it's just sets with a mixture of types that have issues? |
Logged a separate issue, seems it also happens for maps. I think the |
Make sure we don't report a difference when there is none. For sets the issue came from handling them as ordered collections when they aren't, with maps we had a case of using sets as predicates, which breaks when one of the elements is false or null. Closes #43
I renamed the function and namespace to @humorless seems you're all good now, the problem wasn't your code or the test, the problem was already there, but it's fixed now. |
Two remarks,
Actually, now that I write this I'm not sure if we descend into map keys when diffing... Anyway, great work, happy to have this feature. Next we can think about how to expose this in kaocha. |
The two remarks are totally true. I only thought of the most typical cases when implemented. |
Try to solve the issue #13 with an API
remove-unchanged
, test, CHANGLOG