liveBook · Manning

Evaluation suite

As explained in Refactoring to Rust

A test suite is a collection of automated tests that collectively validate a software component.

A test suite is a collection of automated tests that collectively validate a software component. In Rust, tests commonly live in a tests module marked with #[cfg(test)], keeping them out of production builds while Cargo compiles and runs them when requested. section 7.1

A minimal suite

A library can test that 2 + 2 equals 4, then run the suite with cargo test. A deliberately incorrect assertion demonstrates failure reporting; --nocapture displays test output.

How Refactoring to Rust covers it

How deep it goes
Explains test modules, attributes, assertions, execution, output, and failure diagnostics, but not broader testing strategies.
Examples
Uses a 2 + 2 equality check, a deliberately failing assertion, and captured standard output.
What it assumes
Assumes basic Rust library structure and introduces test modules, attributes, assertions, and conditional compilation incrementally.
What you can do after
Operate Cargo to run tests, inspect failures, and reveal captured output with command-line options.
How it connects
Connects unit tests with conditional compilation, assertions, Cargo, and compiler test builds.

Also explained in

Compare how 11 books explain evaluation suite →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Refactoring to Rust. The section links point to the parts of the book it draws on.