Skip to content

Rust Testing Patterns

Write Rust unit, integration, async, and property-based tests using a TDD workflow.

Repository
affaan-m/ECC
Stars
295,127
Licence
MIT
Files
1 file

What it does

When installed, the agent follows a structured approach to testing Rust code. It knows how to write standard Rust tests, parameterized tests with rstest, property-based tests with proptest, async tests with Tokio, and mocks with mockall, and it guides work through a red-green-refactor cycle (write a failing test, make it pass, then tidy up). It also suggests checking coverage with cargo-llvm-cov, aiming for 80% or more.

Great for

  • Rust developers who want tests written to a consistent pattern
  • Teams practising test-driven development in Rust projects
  • Developers adding test coverage to existing Rust crates

Skip it if

  • Non-Rust projects, since the patterns are specific to Rust and its cargo tooling
  • Experienced Rust testers who only need a quick syntax reminder, as the file is mostly reference examples

Try asking

  • “Write unit tests for this Rust function using the TDD red-green-refactor cycle”
  • “Add integration tests in the tests/ folder for my HTTP API handlers”
  • “Create proptest property-based tests for my encode and decode functions”
  • “Set up async tests with tokio for my database client and check coverage with cargo-llvm-cov”
Step-by-step guide: how to use Rust Testing PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    rust-testing.zip
  2. 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. 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

  • Name the crate and the function or module you want tested so the agent can match the examples to your code
  • Ask for RED first so you can confirm the test fails before implementation is written
  • Say which test types you need (unit, integration, async, property-based) to keep the output focused

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.