cargo-test
Installation
SKILL.md
cargo-test
Overview
Per doc.rust-lang.org/book/ch11-00-testing.html:
Rust's testing is built into Cargo. The #[test] attribute marks
test functions; cargo test discovers and runs them.
Three test categories per the Rust Book:
| Category | Location | Purpose |
|---|---|---|
| Unit tests | Same file as code, in #[cfg(test)] mod tests { ... } |
Test private + internal logic |
| Integration tests | tests/ directory at crate root |
Test public API as external user |
| Doc tests | Inside /// doc comments |
Verify documentation examples |