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

returning Nil on empty IntMap as done in corresponding functions for Map #1065

Merged
merged 2 commits into from
Nov 10, 2024

Conversation

kushagarr
Copy link
Contributor

@kushagarr kushagarr commented Nov 8, 2024

Closes #1061

@meooow25

@treeowl
Copy link
Contributor

treeowl commented Nov 8, 2024

The link to the issue doesn't work .

@kushagarr
Copy link
Contributor Author

@treeowl Fixed it.

Copy link
Contributor

@treeowl treeowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust the property tests accordingly.

@meooow25
Copy link
Contributor

meooow25 commented Nov 8, 2024

Thanks for the PR. Your change seems fine, but as mentioned above please update/add property tests for affected functions. These will be in containers-tests/intmap-properties.hs.

@treeowl
Copy link
Contributor

treeowl commented Nov 8, 2024

@meooow25 , it's obviously not an issue for this PR, but it looks like we only have unit tests for these and many other IntMap functions, and no property tests. That's no good!

@kushagarr
Copy link
Contributor Author

So, what is it that I should be doing here,
If I take updateMinWithKey as an example, I see only one Assertion called test_updateMinWithKey in containers-tests/tests/intmap-properties.hs.

Should I just update that assertion to have this change also included in that or you want me to add property tests for this as well.
FYI, Although I have read about tests and property tests in Haskell, I haven't really written them in Haskell before, So please bear with me and guide me if I make mistakes.

@meooow25
Copy link
Contributor

meooow25 commented Nov 9, 2024

I took at look at the tests we have. You could add a new unit test for the empty map case in test_updateMinWithKey, test_updateMaxWithKey, etc. That's good enough for this PR.
Otherwise, if you want to add new property tests for these functions, it would be very helpful. Let us know if you need any help.

...but it looks like we only have unit tests for these and many other IntMap functions, and no property tests. That's no good!

Yes that's not ideal, we should look into having property tests for everything.

@kushagarr
Copy link
Contributor Author

Not able to come up with property tests yet, apologies.
I need more time may be.

@treeowl
Copy link
Contributor

treeowl commented Nov 9, 2024

Not able to come up with property tests yet, apologies. I need more time may be.

Don't worry about that. @meooow25 opened a new issue to deal with that.

@meooow25 meooow25 merged commit 5b3da8f into haskell:master Nov 10, 2024
12 checks passed
@meooow25
Copy link
Contributor

Thanks!

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 this pull request may close these issues.

updateMax Map/IntMap discrepancy
3 participants