rust-testing-code-review
Installation
SKILL.md
Rust Testing Code Review
Review Workflow
- Check Rust edition — Note edition in
Cargo.toml(2021 vs 2024). Edition 2024 changes temporary scoping inif letand tail expressions, and makes#[expect]the preferred lint suppression - Check test organization — Unit tests in
#[cfg(test)]modules, integration tests intests/directory - Check async test setup —
#[tokio::test]for async tests, proper runtime configuration. Check forasync-traiton mocks that could use nativeasync fnin traits - Check assertions — Meaningful messages, correct assertion type. Review
if letassertions for edition 2024 temporary scope changes - Check test isolation — No shared mutable state between tests, proper setup/teardown. Prefer
LazyLockoverlazy_static!/once_cellfor shared fixtures - Check coverage patterns — Error paths tested, edge cases covered
Gates (hard)
Do not advance to Output Format until each pass condition is satisfied (yes/no with a concrete artifact).
- Edition recorded — Open the target crate’s
Cargo.toml(or workspace[workspace.package]/ inherited edition) and note theeditionvalue. Pass: you can quoteedition = "…"(or document “inherited from workspace”) before citing Rust 2024–specific behavior (if let/ tail temporary drops,#[expect]vs#[allow]migration, nativeasync fnin traits as default). If edition is not2024, do not report those items as edition-2024 regressions; at most Informational if still useful. dynvs static async mocks — Before suggesting nativeasync fnin traits instead ofasync-trait, check whether the mock is used asdyn Trait. Pass: ifdynis required, you either skip that suggestion or align with Valid Patterns (async-traitstill needed).- Verification protocol — Pass: steps from the review-verification-protocol skill are done before any finding is listed (see Before Submitting Findings).