test(vex): cover VexStatus::from_openvex affected/fixed arms#53
Merged
Conversation
Final two survivors from the #35 cargo-mutants follow-up run: - delete match arm "affected" in VexStatus::from_openvex - delete match arm "fixed" in VexStatus::from_openvex Adds a table-driven round-trip across all four OpenVEX statuses (not_affected, affected, fixed, under_investigation) exercising both from_openvex() and as_str(), plus a negative test that empty / case-mismatched / cross-format strings return None instead of silently mapping to a wrong arm. Brings cargo-mutants kill rate on src/vex/** to 100% on viable mutants (82 caught, 0 missed, 15 unviable expected).
Coverage reportLine coverage: 85.4% (9723 / 11386 lines) Full lcov report available as workflow artifact coverage-lcov: download from this run. v0.9.8 introduces this report; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the last two cargo-mutants survivors from #35.
Surviving mutants killed
The prior suite covered
not_affected/under_investigationindirectly through end-to-end fixtures, but never asserted thatfrom_openvex("affected")/from_openvex("fixed")mapped to the right variants — so deleting either arm still let every test pass.What this adds
vex_status_from_openvex_round_trips_all_arms— table-driven, assertsfrom_openvex(s) == expectedandas_str()round-trips back tosfor all four OpenVEX statuses.vex_status_from_openvex_rejects_unknown_strings— empty string, capitalizedAffected, the CycloneDX-flavoredexploitable, and a space-separated variant all returnNone(no silent fallthrough).Verification
cargo test --release --lib vex_status_from_openvex: 2 passedRUSTFLAGS="-D warnings" cargo build --all-targets --all-features: cleancargo clippy --all-targets --all-features -- -D warnings: cleancargo fmt --check: cleanAfter this lands,
src/vex/**should be at 100% kill rate on viable mutants (82 caught / 0 missed / 15 unviable), up from 97.6% after #51 + #52.