-
Notifications
You must be signed in to change notification settings - Fork 449
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
Improve map test coverage #2980
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.
Nice work! I've left a small comment, because I think that associate
reads better than map
+ toMap
most of the times.
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/map.kt
Outdated
Show resolved
Hide resolved
@abendt I've decided to remove the tests that checked that |
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/map.kt
Outdated
Show resolved
Hide resolved
…p.kt Co-authored-by: Alejandro Serrano <[email protected]>
* add test for filterIsInstance identity
Context
See issue #2894
Changes
i have ported some of the tests from here: https://github.com/arrow-kt/arrow-core/tree/master/arrow-core-test/src/main/kotlin/arrow/core/test/laws
otherwise not all code paths are executed. i have added a test and left some comments that ensures that the generated maps share enough keys. With the previous solution often maps didn't share any keys. I was also thinking about to implement a specialized Arb for this task (see discussion here property testing: generate two maps that share some keys kotest/kotest#3459)
Edit: with awesome help from the kotest slack i implemented a specialized Arb (see the linked issue)