rust-testing
Installation
SKILL.md
Rust Testing
適用場景
- 為 Rust 函式、模組、crate 撰寫單元測試與整合測試
- 使用 TDD(紅 → 綠 → 重構)流程開發新功能或修復 bug
- 以 proptest / quickcheck 進行屬性測試,自動產生邊界案例
- 以 mockall 建立 trait mock,隔離外部依賴
- 以 cargo-llvm-cov 產生覆蓋率報告,確保 ≥80% 行覆蓋
- 以 cargo-nextest 加速大量測試的平行執行
- 撰寫 async 測試(tokio::test / async-std)
- 撰寫 doc tests 確保文件範例可編譯執行