Skip to content

Commit 0a29ba6

Browse files
committed
Add a test for a missing preprocessor
1 parent 4d9095b commit 0a29ba6

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

tests/testsuite/preprocessor.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,19 @@ fn relative_command_path() {
149149
.check_file("support-check", "html")
150150
.check_file("preprocessor-ran", "test");
151151
}
152+
153+
// Preprocessor command is missing.
154+
#[test]
155+
fn missing_preprocessor() {
156+
BookTest::from_dir("preprocessor/missing_preprocessor").run("build", |cmd| {
157+
cmd.expect_stdout(str![[""]])
158+
.expect_stderr(str![[r#"
159+
[TIMESTAMP] [INFO] (mdbook_driver::mdbook): Book building has started
160+
[TIMESTAMP] [WARN] (mdbook_driver::builtin_preprocessors::cmd): The command wasn't found, is the "missing" preprocessor installed?
161+
[TIMESTAMP] [WARN] (mdbook_driver::builtin_preprocessors::cmd): [TAB]Command: trduyvbhijnorgevfuhn
162+
[TIMESTAMP] [INFO] (mdbook_driver::mdbook): Running the html backend
163+
[TIMESTAMP] [INFO] (mdbook_html::html_handlebars::hbs_renderer): HTML book written to `[ROOT]/book`
164+
165+
"#]]);
166+
});
167+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[preprocessor.missing]
2+
command = "trduyvbhijnorgevfuhn"
3+

tests/testsuite/preprocessor/missing_preprocessor/src/SUMMARY.md

Whitespace-only changes.

0 commit comments

Comments
 (0)