rust-testing
Rust testing patterns for unit, integration, async, doc, property, snapshot, fuzz, and benchmark-adjacent tests. Use when writing or reviewing tests for `.rs` code, reducing flakiness, designing fixtures/fakes, improving CI confidence, hardening `unsafe`/FFI/parsers with Miri and sanitizers, or test
v2026.11.13-21cd5683 instalações+3 em 7 dias39 EstrelasMITsincronizado há 11 horas
Instalar
Ainda não tem a CLI da NotHoly? Instale primeiro.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install aeondave/rust-testingGrava em ~/.notholy/skills depois de conferir a assinatura e o SHA-256.
AssinaturaAssinado, ed25519
Pacote088d5f16…83195b8d
088d5f16478f…f19583195b8d8 arquivos · 10.3 KBVarreduraBaixo1 achado
- Links para domínios externos
Fontegithub.com/AeonDave/malskill/tree/main/coding/rust-testing@21cd568
Este item ainda não foi escrito no seu idioma, então aparece em English.
Nesta página
High-signal guidance for Rust tests that are deterministic, maintainable, and worth running.
Use this skill when tests are part of the change, when flakiness needs to die quietly, or when CI needs stronger signal.
When to activate
- Adding unit, integration, async, or doctests for Rust code
- Refactoring brittle or slow Rust tests
- Introducing fakes, mocks, property tests, or snapshot tests
- Tightening CI feedback with coverage, nextest, or command selection
- Hardening parsers,
unsafe, or FFI code against arbitrary input with fuzzing, Miri, or sanitizers - Testing locks, atomics, or shutdown joins (Loom, Miri races, deadlock)
Core rules
- Prefer small unit tests for logic and integration tests for public behavior and boundaries.
- Keep tests deterministic: avoid sleep-based timing and shared mutable global state.
- Use mocks sparingly; prefer fakes, temp dirs, test servers, and controlled inputs.
- Treat doctests as part of the public contract, not decorative comments.
- Coverage is a signal, not the goal; strong assertions beat inflated percentages.
- Avoid production-only test hooks unless they expose a legitimate public or crate-private seam.
- Pair with
test-driven-developmentwhen implementing persistent code or bug fixes test-first. - Pair with
testing-reliabilityfor mock/timing anti-patterns andsystematic-debuggingwhen the root cause is unclear.
Outcome expectations
- Tests are deterministic, debuggable, and fast enough to run frequently.
- Boundaries (time/fs/network/randomness) are explicit and controllable.
- CI separates fast confidence checks from heavier coverage/property/snapshot stages.
Recommended workflow
- Start with focused unit/integration tests for the behavior change.
- Run targeted commands before full-suite reruns.
- Stabilize async/boundary tests via explicit timeouts and local fixtures.
- Add property/snapshot tests when they increase signal, not just volume.
- Verify CI command mix remains fast and reproducible.
Quick review checklist
- Test names describe behavior, not implementation trivia
- Setup is short and local; helpers remove noise without hiding intent
- External boundaries (time, filesystem, network, randomness) are controlled explicitly
- Async tests await real conditions instead of sleeping and hoping
- CI runs the right mix of
cargo test, doctests, and any nextest/coverage steps
Resources
Load on demand:
references/unit-and-integration.md— use when deciding what belongs beside the code vs undertests/, when pickingrstestover table loops,should_panicdiscipline, ortrybuildcompile-fail testsreferences/async-and-boundaries.md— use when testing async code, time, IO, and network boundariesreferences/property-snapshot-and-mocks.md— use when example-based tests are not enough, when output is bulky, or when scriptingmockallexpectationsreferences/fuzzing-and-sanitizers.md— use to hunt panics, memory-safety bugs, and UB on arbitrary input (cargo-fuzz, arbitrary, AFL, Miri, sanitizers)references/concurrency-testing.md— load when testing atomics/Mutex/channels: Loom models, Miri races vs TSan, deadlock/OnceLockre-entryreferences/coverage-and-ci.md— use when wiring coverage, nextest profiles, mutation testing, or stable CI gatesreferences/commands.md— use for the most common Rust test commands and selectors
Arquivos desta versão
references/719.9 KB
- async-and-boundaries.md1.8 KB
- commands.md1.5 KB
- concurrency-testing.md4.2 KB
- coverage-and-ci.md2.0 KB
- fuzzing-and-sanitizers.md5.2 KB
- property-snapshot-and-mocks.md2.0 KB
- unit-and-integration.md3.3 KB
- SKILL.md4.1 KB
Permissões
| Permissão | Declarada | Encontrada na varredura |
|---|---|---|
| Lê arquivos | Não | Não |
| Grava arquivos | Não | Não |
| Roda comandos no shell | Sim | Sim |
| Usa a rede | Sim | Sim |
| Usa conectores | Não | Não |
| Controla um navegador | Não | Não |
Achados da varredura
Revisado em 13 de nov. de 2026
- InfoLink · Links para domínios externos
Uma varredura limpa reduz o risco, mas não prova que o pacote é seguro. Leia o que você instala.
| Versão | Publicada em | Commit | SHA-256 | Assinatura | Mudança de permissão |
|---|---|---|---|---|---|
| v2026.11.13-21cd568 | 13 de nov. de 2026 | 21cd568 | 088d5f16 | Assinada | – |
Mais de AeonDave
Tudo deste publicadorMais em Engenharia reversa e fuzzing
Ver a categoriaPergunte tudo o que o seu escopo permite.
Crie a conta, adicione créditos e faça a primeira pergunta no chat ou no terminal.
- 1/3
Crie a conta
Individual ou empresa. Dá para virar empresa depois sem perder saldo nem chaves.
Pessoa físicaEmpresa - 2/3
Adicione créditos
No cartão. Você paga por token, sem assinatura.
$5.00recarga mínima - 3/3
Pergunte
No chat, ou instale o CLI e rode notholy login no terminal.
$ notholy login