Rust test
Rust testing workflow for unit, integration, doc, snapshot, property, async, regression, and coverage-aware tests in greenfield Cargo projects. Use for creating, improving, validating, or reviewing Rust tests.From its SKILL.md
npx -y skills add nyquistwilder/personal-pi --skill rust-testAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.6 KB, 528 tokens by cl100k_base, as published. Nobody here has run it
Rust Test
Rule
Test public behavior with deterministic tests. Prefer unit tests near implementation, integration tests for crate behavior, doctests for documented examples, and regression tests for bugs.
Hard Stops
Stop before:
- Tests touch production services, real secrets, user files, live databases, or shared mutable infrastructure.
- Adding test dependencies such as
insta,proptest,quickcheck,testcontainers,wiremock,mockall, or Tokio test utilities without approval or project precedent. - Snapshot tests would hide unclear behavior instead of documenting an intentional contract.
- Async or concurrency tests rely on sleeps rather than deterministic synchronization.
Defaults
- Use
#[test], module-level unit tests,tests/*.rsintegration tests, and doctests. - Use
#[tokio::test]only for Tokio projects; keep runtime features explicit. - Use
tempfilewhen filesystem isolation is needed and approved. - Use
assert_eq!/matches!and meaningful failure messages; avoid over-broad snapshots. - Use
instaonly for stable structured output where focused assertions are worse. - Use
proptestfor parsers, serializers, normalizers, and invariant-heavy code. - Use
wiremockor localaxum/hypertest servers for HTTP clients; never call live services by default. - Use
cargo-nextestwhen already configured; otherwisecargo testis the baseline.
Workflow
- Inspect existing tests, features, fixtures, and wrapper commands.
- For bugs, write or run a focused failing regression test first when practical.
- Cover success, failure, edge cases, cancellation, and public error behavior.
- Keep fixtures small and local; use files only when file format/path behavior is contract.
- Run targeted
cargo test <name>or package-specific tests. - Run full
cargo test --all-targets --all-featuresor project wrapper. - Run doctests, async tests, property seeds, snapshots, or coverage only when relevant.
- Run
just checkbefore handing back.
Coverage
Use cargo llvm-cov only when configured or approved. Coverage is a signal; do not add weak
assertions or test-only branches to raise a number. Prefer assertions that would fail for
real regressions.
Completion
Report tests added, commands run, async/snapshot/property/container choices, coverage result when measured, and remaining untested risk.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.