For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /packs/languages/rust/testing.md.
Quick start

Testing

Combine focused value tests, resource integration tests, and public doctests.

Verification

Why

Ownership compilation does not prove that an adapter preserves unrelated files or reports the correct failure variant.

Rules

  • MUST test consequential valid and invalid inputs through native Result variants. [review]
  • MUST use real disposable local resources for filesystem and subprocess contracts. [review]
  • MUST run Cargo tests and public doctests for the affected crate. [review]
  • MUST run rustfmt and the consumer's configured Clippy checks. [review]
  • MUST keep fixture assertions distinct from production error handling. [review]
  • MUST isolate resource tests so parallel runs cannot alter another test's state. [review]
  • MAY use property tests for parsers and transformations after dependency approval. [review]
  • MAY use nextest when it is already part of the consumer's toolchain. [review]

[review]

Cargo, rustfmt, and configured Clippy invocations provide executable checks. Review checks whether the suite exercises the actual contract.

Enforcement

Cargo, rustfmt, and configured Clippy invocations provide executable checks. Review checks whether the suite exercises the actual contract.