rust-testing is agent-read markdown (skill) from kunanonj/ai-skills-hub: Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology..
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# Rust Testing Patterns
Comprehensive Rust testing patterns for writing reliable, maintainable tests following TDD methodology.
## When to Use
- Writing new Rust functions, methods, or traits
- Adding test coverage to existing code
- Creating benchmarks for performance-critical code
- Implementing property-based tests for input validation
- Following TDD workflow in Rust projects
## How It Works
1. **Identify target code** — Find the function, trait, or module to test
2. **Write a test** — Use `#[test]` in a `#[cfg(test)]` module, rstest for parameterized tests, or proptest for property-based tests
3. **Mock dependencies** — Use mockall to isolate the unit under test
4. **Run tests (RED)** — Verify the test fails with the expected error
5. **Implement (GREEN)** — Write minimal code to pass
6. **Refactor** — Improve while keeping tests green
7. **Check coverage** — Use cargo-llvm-cov, target 80%+
## TDD Workflow for Rust
### The RED-GREEN-REFACTOR Cycle
```
RED → Write a failing test first
GREEN → Write minimal code to pass the test
REFACTOR → Improve code while keeping tests green
REPEAT → Continue with next requirement
```
### Step-by-Step TDD in Rust
```rust
…
Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
GET https://markdownregistry.com/api/v1/artifacts/art_6yvmrrwfkyp6mxqa
GET https://markdownregistry.com/api/v1/resolve?ref=kunanonj/ai-skills-hub/rust-testing
GET https://markdownregistry.com/api/v1/blob/e55dc89ab64a49f9cec0d6d15b14a21f5c096f342e0046799f47b7fa2d22e770
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
kunanonj/ai-skills-hub · .agents/skills/analyze-codebase-for-mcp/SKILL.md · Analyze an arbitrary codebase to identify functions, APIs, and data sources suitable for exposure as MCP tools…
kunanonj/ai-skills-hub · .agents/skills/api-analyzer/SKILL.md · Validates whether an API request is correct based on provided inputs (method, URL, headers, body, auth, query params)…
kunanonj/ai-skills-hub · .agents/skills/api-design-principles/SKILL.md · Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight…
kunanonj/ai-skills-hub · .agents/skills/architecture-decision-records/SKILL.md · Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the…
kunanonj/ai-skills-hub · .agents/skills/backend-api-design/SKILL.md · Design RPC-style APIs with layered architecture (Controller → Manager → Repository). Use when creating new API…
kunanonj/ai-skills-hub · .agents/skills/backend-dev-guidelines/SKILL.md · You are a senior backend engineer operating production-grade services under strict architectural and reliability…
kunanonj/ai-skills-hub · .agents/skills/backend-security-coder/SKILL.md · Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use…
kunanonj/ai-skills-hub · .agents/skills/browser-screenshot-diff/SKILL.md · Visual + DOM diff between two recorded sessions at matching trajectory step ids; used for visual regression and replay…
kunanonj/ai-skills-hub · .agents/skills/browser-testing-with-devtools/SKILL.md · Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use…
affaan-m/ecc · docs/es/skills/rust-testing/SKILL.md · Patrones de pruebas en Rust incluyendo pruebas unitarias, de integración, async, basadas en propiedades, mocking y…
kalarislabs/skill-doctor · skills/rust-testing/SKILL.md · How to write Skill Doctor tests — unit, integration, CLI, fixtures, determinism, additive-only. Use when adding tests…