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
Add more mutation testing to the pow
module
#1510
Add more mutation testing to the pow
module
#1510
Conversation
86cf1d3
to
0cea7ec
Compare
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.
ACK 0cea7ec
Fix a trivial grammatical mistake in code comment.
Plain integer does not require parenthesis, remove them.
Recently we introduced some mutation testing to the `pow` module but testing is never done - add more `mutate` attributes and add unit tests to ensure all mutants are killed. Of note, the `from_compact` and `to_compact_lossy` functions are not done, doing so results in a bunch of surviving mutants.
0cea7ec
to
308c727
Compare
Changes in force push:
|
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.
ACK 308c727
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.
ACK 308c727
fn u256_is_max_correct_positive() { | ||
assert!(U256::MAX.is_max()); | ||
|
||
let u = u128::max_value(); |
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.
FYI max_value()
is deprecated and the MAX
associated const should be used
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.
I believe MAX
is not available in 1.41.
Add more mutation testing to the
pow
module.The first two patches are preparatory clean up.
All functions/methods that are non-trivial are tested excluding:
to_compact_lossy
from_compact
fmt_decimal
I think its ok to not test
fmt_decimal
. The compact format ones require a bit of work to do but should be done at some stage.