
Rust Testing Patterns
Guides an agent through Rust unit, integration, async, property-based and mocked tests using TDD.
- Repository
- affaan-m/ECC
- Stars
- 295,127
- Licence
- MIT
- Files
- 1 file
What it does
When installed, the agent follows a documented set of Rust testing practices: writing tests first (red, green, refactor), organising unit and integration tests, testing errors and panics, running async tests with Tokio, parameterised tests with rstest, and property-based tests with proptest. It also suggests mockall for isolating dependencies and cargo-llvm-cov to check coverage against an 80% target. The file is a written guide with code examples; it contains no scripts of its own.
Great for
- Rust developers who want consistent, test-first habits when writing new functions or traits
- Teams adding test coverage to existing Rust code
- Developers learning which Rust testing crates (rstest, proptest, mockall) to use
Skip it if
- Non-Rust projects, since the examples only apply to Rust (no reason to install it elsewhere)
- Projects that already have an established testing convention that conflicts with these patterns, as the agent may push its own style
Try asking
- “Write failing tests first for a new Rust function that parses a config file, then implement it”
- “Add unit tests to my user.rs module covering invalid email handling”
- “Set up proptest round-trip tests for my encode and decode functions”
- “Check whether my crate reaches 80% coverage using cargo-llvm-cov”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 1 original files, the MIT licence and an attribution note.
rust-testing.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip rust-testing.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip rust-testing.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Ask the agent to run cargo test after each step so the red and green stages are actually observed
- Name the crates you already use so the agent follows your project's dependencies rather than adding new ones
- Review any dependency the agent adds to Cargo.toml before accepting it
What's inside
- SKILL.md
Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.