rust-test-toolslisted
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