How to use doc tests

Run mdbook test with the correct library path to execute doc tests in your Rust book.

Run mdbook test to execute doc tests embedded in your markdown files. If your book depends on external crates like trpl, build them first and pass the dependency path to ensure tests resolve correctly.

cd packages/trpl && cargo build
mdbook test --library-path packages/trpl/target/debug/deps