Repository navigation
Add tests for the gaps found by mutation testing - #47
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused tests correctly cover both identified mutation-testing gaps without changing library behavior.
0 open findings
What changed in this PR
Adds mutation-testing regression coverage for sponge output wiping and IO-pattern length bounds.
Changes:
- Verifies buffered output is zeroized when an unfinished sponge is dropped.
- Tests valid and invalid lengths around the
2^31 − 1boundary.
| File | Description |
|---|---|
src/sponge.rs |
Adds drop-time output wiping coverage. |
src/lib.rs |
Adds IO-pattern boundary validation coverage. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Mutation testing of dusk-safe 0.4.0 found code that no test pins. Each test below fails on the mutant it targets: - Test that dropping a sponge wipes its output - Test the IO-pattern call length bound
5e59c49 to
58503ee
Compare
|
Force-pushed: squashed into one commit. The tree is unchanged. |
moCello
left a comment
There was a problem hiding this comment.
APPROVE
Both tests can fail for the reason they claim, and the change stays inside the scope of the linked issue.
The drop test watches the first buffered output element through the test allocator. If the Drop body or the output wipe in zeroize is removed, the allocator reads 99 at deallocation and the assertion fails. The length test accepts a call of exactly 2^31 − 1 and rejects 2^31 on both the absorb side and the squeeze side. This kills the >= mutant, the removed-bound mutant, and the changed-shift mutant on MAX_LEN. Both tests sit in the inline test modules next to the private items they use. The commit message, the pull request and the issue agree on the scope: tests only, with no changelog entry.
Summary
Resolves #46.
Tests only, so there is no changelog entry. Each test fails on the mutant it targets and passes on the released dusk-safe 0.4.0.