]>
git.proxmox.com Git - rustc.git/blob - vendor/mdbook/tests/testing.rs
3 use crate::dummy_book
::DummyBook
;
8 fn mdbook_can_correctly_test_a_passing_book() {
9 let temp
= DummyBook
::new().with_passing_test(true).build().unwrap();
10 let mut md
= MDBook
::load(temp
.path()).unwrap();
12 let result
= md
.test(vec
![]);
15 "Tests failed with {}",
21 fn mdbook_detects_book_with_failing_tests() {
22 let temp
= DummyBook
::new().with_passing_test(false).build().unwrap();
23 let mut md
= MDBook
::load(temp
.path()).unwrap();
25 assert
!(md
.test(vec
![]).is_err());
29 fn mdbook_test_chapter() {
30 let temp
= DummyBook
::new().with_passing_test(true).build().unwrap();
31 let mut md
= MDBook
::load(temp
.path()).unwrap();
33 let result
= md
.test_chapter(vec
![], Some("Introduction"));
36 "test_chapter failed with {}",
42 fn mdbook_test_chapter_not_found() {
43 let temp
= DummyBook
::new().with_passing_test(true).build().unwrap();
44 let mut md
= MDBook
::load(temp
.path()).unwrap();
46 assert
!(md
.test_chapter(vec
![], Some("Bogus Chapter Name")).is_err());