rust-testing

Automate Rust testing workflows with cargo test, Tokio, proptest, and mockall.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/SOLEROM/cldlab --skill rust-testing-solerom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-testing
Source: https://github.com/SOLEROM/cldlab/tree/main/ecc/ref_claude/skills/rust-testing
Command: npx skills add https://github.com/SOLEROM/cldlab --skill rust-testing-solerom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to Rust testing, enabling teams to implement unit tests, integration tests, async tests, property-based tests, and mocking within a TDD workflow, improving reliability and maintainability.

Core Features & Use Cases

  • Test coverage patterns: unit tests via #[test], integration tests in tests/ directory, and async tests with Tokio.
  • Property-based testing & mocking: using proptest and mockall for robust edge-case handling and isolation.
  • Guided workflow: resources and patterns designed for TDD from red to green to refactor.

Quick Start

Run cargo test in your Rust project to execute unit, integration, and property-based tests following a TDD workflow.

Frequently Asked Questions about rust-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Rust unit tests and integration tests for a cargo project?

Rust unit tests use the #[test] attribute within source modules, while integration tests reside in the tests/ directory. Run cargo test to execute both, ensuring reliable test coverage across your library or application.

What is the best way to write async tests in Rust using Tokio?

Async tests in Rust using Tokio are automated by applying async test attributes to your functions. This allows your test suite to properly await asynchronous operations and validate concurrent logic reliably.

How do I use mockall for mocking dependencies in Rust testing workflows?

Mocking in Rust testing is handled by mockall to isolate modules and simulate dependency behavior. It automates mock object generation, allowing your unit tests to verify interactions without relying on external systems.

Does property-based testing with proptest help find edge cases in Rust libraries?

Property-based testing with proptest validates Rust functions against randomly generated inputs to uncover edge cases. It automates input shrinking to find the minimal failing test case, improving test suite robustness.

Can I apply a TDD workflow from red to green to refactor in Rust?

TDD workflows in Rust are supported through guided patterns moving from red to green to refactor. This approach structures your cargo test cycles to ensure high coverage and maintainable code throughout development.