Add a test for a missing preprocessor

This commit is contained in:
Eric Huss 2025-08-16 13:33:38 -07:00
parent 4d9095b603
commit 0a29ba6eb6
3 changed files with 19 additions and 0 deletions

View file

@ -149,3 +149,19 @@ fn relative_command_path() {
.check_file("support-check", "html")
.check_file("preprocessor-ran", "test");
}
// Preprocessor command is missing.
#[test]
fn missing_preprocessor() {
BookTest::from_dir("preprocessor/missing_preprocessor").run("build", |cmd| {
cmd.expect_stdout(str![[""]])
.expect_stderr(str![[r#"
[TIMESTAMP] [INFO] (mdbook_driver::mdbook): Book building has started
[TIMESTAMP] [WARN] (mdbook_driver::builtin_preprocessors::cmd): The command wasn't found, is the "missing" preprocessor installed?
[TIMESTAMP] [WARN] (mdbook_driver::builtin_preprocessors::cmd): [TAB]Command: trduyvbhijnorgevfuhn
[TIMESTAMP] [INFO] (mdbook_driver::mdbook): Running the html backend
[TIMESTAMP] [INFO] (mdbook_html::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
"#]]);
});
}

View file

@ -0,0 +1,3 @@
[preprocessor.missing]
command = "trduyvbhijnorgevfuhn"