← ClaudeAtlas

rust-test-toolslisted

Dynamic check toolkit beyond cargo test — cargo-nextest as the baseline runner, cargo-careful (hardened std where Miri cannot run), loom (concurrency model checker), proptest (property tests), cargo-fuzz (libFuzzer), cargo-mutants with survived-mutant triage, and golden tests for deterministic output. Use when you write or review tests for unsafe code, hand-rolled atomics and lock-free primitives, parsers and decoders that read untrusted bytes, FFI boundaries, deterministic export pipelines, or before you promote an AI-generated module past basic test coverage.
po4yka/rust-skills · ★ 2 · AI & Automation · score 76
Install: claude install-skill po4yka/rust-skills
# Rust Test Tools ## Purpose `cargo test --locked` and `cargo nextest run --locked` are necessary but not sufficient. They do not find these failure modes: - Undefined behavior (UB) in `unsafe` code. - Data races in lock-free atomics. - Missing edge cases in parsers and decoders. - Behavior changes that pass weak tests but break under exhaustive exploration. - Non-deterministic output from a pipeline that promises determinism. This skill lists the dynamic toolkit beyond Miri. It tells you when to reach for each tool. ## Tool selection decision tree ```text Is there `unsafe` in the change? ├── FFI / UniFFI / JNI / inline asm / syscalls / libc? │ └── YES → cargo-careful + sanitizers (ASan/TSan/MSan). │ Miri cannot model FFI. See `rust-sanitizers-miri` for ASan/TSan invocations. └── Pure-Rust unsafe (raw pointers, transmute, mem::* tricks)? └── YES → Miri (primary) + cargo-careful (cheaper continuous check). Use `MIRIFLAGS="-Zmiri-tree-borrows -Zmiri-strict-provenance"`. Is the change a custom synchronization primitive (atomic-based flag, hand-rolled spinlock, lock-free queue, publish/subscribe pair)? ├── YES → loom with a `cfg(loom)` test. │ Standard `Mutex` / `RwLock` does NOT need loom. │ Data-parallel code (for example rayon) with no hand-rolled atomics does not │ need loom either. Reach for loom only when a raw atomic crosses threads. Is the change a parser, a decoder, or any function that reads untrusted bytes