From fuse-rust
Use when writing, organizing, or running Rust tests — unit, integration, doc-tests, property-based (proptest), benchmarks (criterion), or mutation testing (cargo-mutants). Covers test layout, the nextest doctest pitfall, and quality gates. Do NOT use for CI pipeline wiring (use rust-tooling-cicd) or non-Rust test suites.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fuse-rust:rust-testing-qualityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Before ANY test work, use `TeamCreate` to spawn 3 agents:
Before ANY test work, use TeamCreate to spawn 3 agents:
tests/, #[cfg(test)], benches/After implementation, run fuse-ai-pilot:sniper for validation.
| Test kind | Location | Runs the code as |
|---|---|---|
| Unit | #[cfg(test)] mod tests inside the source file | Same crate, sees private items |
| Integration | tests/*.rs (each file = own crate) | External consumer, public API only |
| Doc-test | ```rust blocks in /// docs | Compiled + run as examples |
| Property | proptest, inside unit or integration | Generated random inputs + shrinking |
| Benchmark | benches/*.rs with criterion | Statistical timing, not correctness |
cargo nextest run skips them by design. ALWAYS pair with cargo test --doc. Never treat a green nextest run as full coverage.#[cfg(test)], not tests/.proptest-regressions/ - persisted failing seeds must be under version control so failures are reproducible.harness = false for criterion benches - required in Cargo.toml, or the built-in bench harness collides.cargo mutants is slow; run it in scheduled CI, not on every push.my_crate/
├── src/
│ └── lib.rs # unit tests in #[cfg(test)] + doc-tests in ///
├── tests/
│ └── api.rs # integration tests (public API)
├── benches/
│ └── throughput.rs # criterion, harness = false
└── proptest-regressions/ # committed failing seeds
→ See test-suite.md for the complete example
| Topic | Reference | When to Consult |
|---|---|---|
| Test organization | test-organization.md | Deciding unit vs integration vs doc, running with nextest |
| Property & mutation | property-and-mutation.md | Adding proptest strategies or cargo-mutants |
| Template | When to Use |
|---|---|
| test-suite.md | Scaffolding unit + integration + doc + proptest |
| criterion-bench.md | Adding a criterion benchmark |
cargo nextest run --all-features # unit + integration, fast, parallel
cargo test --doc # doc-tests — NOT covered by nextest
use proptest::prelude::*;
proptest! {
#[test]
fn round_trips(n in 0u32..10_000) {
prop_assert_eq!(decode(&encode(n)), n);
}
}
→ See test-suite.md for the full file
cargo nextest run + cargo test --doc together in every CI gate#[test] (use criterion in benches/)proptest-regressions/ — commit itcargo mutants on every push (schedule it instead)npx claudepluginhub fusengine/agents --plugin fuse-rustGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.