test(vex): cover misc survivors flagged by cargo-mutants#52
Merged
Conversation
Targets the non-apply.rs survivors from the #35 mutants run: - VexEffect::justification(): assert getter returns the inner Option for both Suppress and Annotate variants, and that None passes through (kills 3 mutants on the getter). - VexIndex::is_empty(): explicit empty vs populated assertions (kills replace-with-true / replace-with-false). - detect_format() CycloneDX arm: SBOM with no `vulnerabilities`, and one with a vulnerabilities object (not array), must NOT match CycloneDxVex. Kills the `&& -> ||` mutant at line 162 that would cause every CycloneDX SBOM to be misdetected as VEX. - parse_synthetic_id() version-jump arm: empty before ("->4") and empty after ("1->") must both reject. Kills the `|| -> &&` mutant at synthetic_id.rs:125 that would have accepted half-empty pairs.
Coverage reportLine coverage: 84.3% (9445 / 11206 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.
What
Follow-up to #51. Targets the remaining (non-
apply.rs) survivors from the #35 cargo-mutants run onsrc/vex/**.Coverage added
VexEffect::justification()— assert the getter returns the innerOptionfor bothSuppressandAnnotatevariants, and thatNonepasses through (not coerced). Kills the 3 mutants on the getter.VexIndex::is_empty()— explicit empty vs populated assertions. Kills replace-with-true/ replace-with-false.detect_format()CycloneDX arm — an SBOM with novulnerabilities, and one with avulnerabilitiesobject (not array), must both NOT matchCycloneDxVex. Kills the&& -> ||mutant atmod.rs:162that would otherwise cause every CycloneDX SBOM to be misdetected as VEX and fail loudly during parse.parse_synthetic_id()version-jump arm — empty before ("->4") and empty after ("1->") must both reject. Kills the|| -> &&mutant atsynthetic_id.rs:125that would accept half-empty version pairs.Test counts
parse_synthetic_id_rejects_malformed_stringsextended with 2 cases)All green locally:
RUSTFLAGS="-D warnings" cargo build --all-targets --all-features+cargo clippy --all-targets --all-features -- -D warnings+cargo fmt --check.Refs #35. Stacks cleanly with #51 (no overlap).