rust-testing
Installation
SKILL.md
Rust 测试与基准测试
基于 The Rust Programming Language ch 11 与 Rustdoc Book。
Capability Boundaries
✅ 强项
- 单元测试(#[test]、测试模块
#[cfg(test)]组织) - 断言宏(assert!、assert_eq!、assert_ne!、debug_assert!)
- 测试属性(#[should_panic]、#[ignore]、#[cfg(test)])
- 集成测试(tests/ 目录与共享模块)
- 文档测试(```rust 代码块、# 隐藏行、should_panic、no_run、ignore)
- cargo test 运行器(过滤、--nocapture、--test-threads、--include-ignored)
- 基准测试(#[bench]、cargo bench、Bencher、criterion)
- 代码覆盖率(cargo-llvm-cov 的使用)
⚠️ 前置要求
- 理解 Rust 模块系统(rust-project-structure)