Rust-skills rust-testing
install
source · Clone the upstream repo
git clone https://github.com/huiali/rust-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/huiali/rust-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/rust-testing" ~/.claude/skills/huiali-rust-skills-rust-testing-e4d692 && rm -rf "$T"
manifest:
skills/rust-testing/SKILL.mdsource content
name: rust-testing description: "Rust testing expert for unit, integration, async, property-based, concurrency, and benchmark testing workflows."---
Rust Testing Skill
Use this skill for detailed, production-ready guidance in this Rust domain.
Core Question
How do we keep tests deterministic, fast, and meaningful?
Solution Patterns
- Use unit tests for logic, integration for contracts
- Use property tests for invariants
- Use loom/criterion for concurrency/perf confidence
Workflow
- Reproduce and isolate the issue with a minimal failing case.
- Choose the smallest safe design that satisfies constraints.
- Implement with explicit ownership, errors, and boundaries.
- Verify with tests, linting, and scenario-specific checks.
Review Checklist
- Correct behavior for both success and failure paths.
- Ownership and API boundaries are explicit.
- Error handling and diagnostics are actionable.
- Performance-sensitive paths are measured.
- Regression tests cover the changed behavior.
Common Pitfalls
- Fixing flakes with sleep
- Over-mocking
- Slow tests in default CI path
Verification Commands
cargo test cargo test -- --nocapture cargo bench cargo nextest run
Related Skills
rust-concurrencyrust-performancerust-database