rust-testing

SKILL.md

Rust Testing Best Practices

Comprehensive testing guide for Rust applications, covering CLI testing, library testing, async patterns, and CI integration. Contains 42 rules across 8 categories, prioritized by impact to guide test design, mocking strategies, and CI optimization.

When to Apply

Reference these guidelines when:

  • Writing unit tests for Rust libraries or modules
  • Creating integration tests for CLI applications
  • Setting up mocking with mockall or trait-based design
  • Testing async code with Tokio
  • Configuring CI pipelines for Rust projects

Rule Categories by Priority

Priority Category Impact Prefix
1 Test Organization CRITICAL org-
2 Mocking and Test Doubles CRITICAL mock-
3 Async Testing HIGH async-
4 Property-Based Testing HIGH prop-
5 Test Fixtures and Setup MEDIUM fix-
6 Assertions and Error Testing MEDIUM assert-
7 CI Integration MEDIUM ci-
8 Test Performance LOW-MEDIUM perf-

Quick Reference

1. Test Organization (CRITICAL)

2. Mocking and Test Doubles (CRITICAL)

3. Async Testing (HIGH)

4. Property-Based Testing (HIGH)

5. Test Fixtures and Setup (MEDIUM)

6. Assertions and Error Testing (MEDIUM)

7. CI Integration (MEDIUM)

8. Test Performance (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

File Description
references/_sections.md Category definitions and ordering
assets/templates/_template.md Template for new rules
metadata.json Version and reference information
Weekly Installs
82
GitHub Stars
71
First Seen
Jan 29, 2026
Installed on
gemini-cli72
codex71
opencode70
github-copilot70
claude-code66
cursor66