Skip to content

Commit 2188f30

Browse files
Add test for configuring output.html.input-404 to a file which doesn't exist
1 parent 8357fca commit 2188f30

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

tests/testsuite/renderer.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,10 @@ fn render_404_from_custom_declared_file() {
295295
assert!(test.dir.join("src/404.md").exists());
296296
assert!(!test.dir.join("book/404.html").exists());
297297
}
298+
299+
/// Declaring a file which doesn't exist via output.html.input-404 in `book.toml` causes a panic
300+
#[test]
301+
#[should_panic(expected = "unable to open 404 input file")]
302+
fn render_404_from_custom_declared_file_which_doesnt_exist_fails() {
303+
BookTest::from_dir("renderer/render_404/explicitly_defined_doesnt_exist_panics").build();
304+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[output.html]
2+
input-404 = "custom_404_filename_which_doesnt_exist.md"

tests/testsuite/renderer/render_404/explicitly_defined_doesnt_exist_panics/src/SUMMARY.md

Whitespace-only changes.

0 commit comments

Comments
 (0)