From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- vendor/mdbook/tests/testing.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'vendor/mdbook/tests/testing.rs') diff --git a/vendor/mdbook/tests/testing.rs b/vendor/mdbook/tests/testing.rs index 2b2c0fd0d..3030c5cb6 100644 --- a/vendor/mdbook/tests/testing.rs +++ b/vendor/mdbook/tests/testing.rs @@ -24,3 +24,24 @@ fn mdbook_detects_book_with_failing_tests() { assert!(md.test(vec![]).is_err()); } + +#[test] +fn mdbook_test_chapter() { + let temp = DummyBook::new().with_passing_test(true).build().unwrap(); + let mut md = MDBook::load(temp.path()).unwrap(); + + let result = md.test_chapter(vec![], Some("Introduction")); + assert!( + result.is_ok(), + "test_chapter failed with {}", + result.err().unwrap() + ); +} + +#[test] +fn mdbook_test_chapter_not_found() { + let temp = DummyBook::new().with_passing_test(true).build().unwrap(); + let mut md = MDBook::load(temp.path()).unwrap(); + + assert!(md.test_chapter(vec![], Some("Bogus Chapter Name")).is_err()); +} -- cgit v1.2.3