rust-testing-best-practices

📁 pproenca/dot-skills 📅 Jan 26, 2026
4
总安装量
4
周安装量
#53971
全站排名
安装命令
npx skills add https://github.com/pproenca/dot-skills --skill rust-testing-best-practices

Agent 安装分布

opencode 4
claude-code 4
codex 4
gemini-cli 2
roo 2
zencoder 2

Skill 文档

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