Skip to content

test(vex): cover misc survivors flagged by cargo-mutants#52

Merged
Metbcy merged 1 commit into
mainfrom
test/35b-vex-misc-coverage
May 18, 2026
Merged

test(vex): cover misc survivors flagged by cargo-mutants#52
Metbcy merged 1 commit into
mainfrom
test/35b-vex-misc-coverage

Conversation

@Metbcy
Copy link
Copy Markdown
Owner

@Metbcy Metbcy commented May 18, 2026

What

Follow-up to #51. Targets the remaining (non-apply.rs) survivors from the #35 cargo-mutants run on src/vex/**.

Coverage added

  • VexEffect::justification() — assert the getter returns the inner Option for both Suppress and Annotate variants, and that None passes 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 no vulnerabilities, and one with a vulnerabilities object (not array), must both NOT match CycloneDxVex. Kills the && -> || mutant at mod.rs:162 that 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 at synthetic_id.rs:125 that would accept half-empty version pairs.

Test counts

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).

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.
@github-actions
Copy link
Copy Markdown

Coverage report

Line 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; --fail-under-lines will be added once coverage is visible across 2–3 releases.

@Metbcy Metbcy merged commit c03a957 into main May 18, 2026
10 checks passed
@Metbcy Metbcy deleted the test/35b-vex-misc-coverage branch May 18, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant