OverviewHistoryStatsSecurity
npx skills add ...
Documentation
SKILL.md
npx skills add affaan-m/ecc --skill rust-testing
Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology. Use when writing Rust tests — unit, integration, async, property-based, or coverage.
npx skills add affaan-m/ecc --skill rust-testing
Comprehensive Rust testing patterns for writing reliable, maintainable tests following TDD methodology.
#[test] in a #[cfg(test)] module, rstest for parameterized tests, or proptest for property-based testsResult Returnsrstestproptestmockall| Code Type | Target |
|---|---|
| Critical business logic | 100% |
| Public API | 90%+ |
| General code | 80%+ |
| Generated / FFI bindings | Exclude |
DO:
#[cfg(test)] modules for unit testsassert_eq! over assert! for better error messages? in tests that return Result for cleaner error outputDON'T:
#[should_panic] when you can test Result::is_err() insteadsleep() in tests — use channels, barriers, or tokio::time::pause()Remember: Tests are documentation. They show how your code is meant to be used. Write them clearly and keep them up to date.