rust-testing

Identify Rust testing patterns for unit, integration, async, property-based, and mocking tests.

1|Updated Jan 30, 2021
One-click install
npx skills add https://github.com/fideguch/my_dotfiles --skill rust-testing-fideguch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-testing
Source: https://github.com/fideguch/my_dotfiles/tree/main/claude/skills/rust-testing
Command: npx skills add https://github.com/fideguch/my_dotfiles --skill rust-testing-fideguch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reliable Rust software requires comprehensive testing across unit, integration, async, and property-based patterns, plus mocking and coverage to prevent regressions and ensure maintainable code.

Core Features & Use Cases

  • Comprehensive Rust test patterns: unit tests, integration tests, async tests, property-based tests, and mocking.
  • Strong drive for TDD workflows: write tests first, drive design, and improve code quality with iterative feedback.
  • Real-world scenarios: validate behavior of functions, modules, and async components, ensuring robust error handling and test coverage.

Quick Start

Write your first test with #[test], run cargo test to execute the test suite and verify it passes.

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 testing patterns for unit, integration, and async tests?

Rust testing patterns for unit, integration, and async tests are structured using #[test] attributes and executed with cargo test to validate functions, modules, and async components. This ensures comprehensive coverage, robust error handling, and maintainable code.

What is the best way to apply TDD workflows in a Rust project?

TDD workflows in Rust involve writing tests first to drive module design and improve code quality through iterative feedback. Using cargo test, you validate behavior early, ensuring robust error handling and preventing regressions across your codebase.

How do I use property-based testing and mocking in Rust?

Property-based testing and mocking in Rust utilize proptest and mockall to validate behavior across generated inputs and simulate dependencies. This combination ensures robust error handling and comprehensive coverage within a TDD framework.

Can I generate test coverage reports with cargo-llvm-cov for Rust projects?

Test coverage reports for Rust projects are generated using cargo-llvm-cov to deliver actionable results and ensure comprehensive coverage. This integrates with cargo test workflows to validate modules, async components, and reusable testing utilities.

Does rstest work with Rust async testing patterns?

rstest supports Rust async testing patterns by enabling parameterized and fixture-driven tests within a TDD framework. Combined with cargo test, it validates behavior across modules and async components to produce reliable, maintainable code.