cargo

Rust cargo test

Compile and execute tests. Use --test to select a named integration-test target. Example format: shell; run from a disposable copy of v15/fixtures/projects/receipt. Expected result (not executed): Exit zero; the three_items test passes. Why: The test checks the public library function against a known expected value. Common mistake: Assuming exit zero proves every possible input is correct.

Formal Syntax & Structure

rust syntaxrust
cargo test [OPTIONS]

Working Example

Example Snippetrust
cargo test --offline --test total
Rust Reference