Skip to content

test(vex): cover VexStatus::from_openvex affected/fixed arms#53

Merged
Metbcy merged 1 commit into
mainfrom
test/35c-vex-status-from-openvex
May 18, 2026
Merged

test(vex): cover VexStatus::from_openvex affected/fixed arms#53
Metbcy merged 1 commit into
mainfrom
test/35c-vex-status-from-openvex

Conversation

@Metbcy
Copy link
Copy Markdown
Owner

@Metbcy Metbcy commented May 18, 2026

Closes the last two cargo-mutants survivors from #35.

Surviving mutants killed

MISSED   src/vex/mod.rs:74: delete match arm "affected" in VexStatus::from_openvex
MISSED   src/vex/mod.rs:75: delete match arm "fixed"    in VexStatus::from_openvex

The prior suite covered not_affected / under_investigation indirectly through end-to-end fixtures, but never asserted that from_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, asserts from_openvex(s) == expected and as_str() round-trips back to s for all four OpenVEX statuses.
  • vex_status_from_openvex_rejects_unknown_strings — empty string, capitalized Affected, the CycloneDX-flavored exploitable, and a space-separated variant all return None (no silent fallthrough).

Verification

  • cargo test --release --lib vex_status_from_openvex: 2 passed
  • Full lib suite: 404 passed (was 402)
  • RUSTFLAGS="-D warnings" cargo build --all-targets --all-features: clean
  • cargo clippy --all-targets --all-features -- -D warnings: clean
  • cargo fmt --check: clean

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

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

Coverage report

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

@Metbcy Metbcy merged commit 8bfa3ce into main May 18, 2026
10 checks passed
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