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
Doc tests let you write code examples directly in your documentation that automatically run to ensure they still work. It is like having a checklist that verifies your instructions are correct every time you update them. You use this to catch broken examples before your readers do.