]>
git.proxmox.com Git - rustc.git/blob - vendor/mdbook/tests/parse_existing_summary_files.rs
1 //! Some integration tests to make sure the `SUMMARY.md` parser can deal with
2 //! some real-life examples.
4 extern crate env_logger
;
5 extern crate error_chain
;
13 macro_rules
! summary_md_test
{
14 ($name
:ident
, $filename
:expr
) => {
17 env_logger
::try_init().ok();
19 let filename
= Path
::new(env
!("CARGO_MANIFEST_DIR"))
21 .join("summary_md_files")
24 if !filename
.exists() {
25 panic
!("{} Doesn't exist", filename
.display());
28 let mut content
= String
::new();
31 .read_to_string(&mut content
)
34 if let Err(e
) = book
::parse_summary(&content
) {
35 use error_chain
::ChainedError
;
37 eprintln
!("Error parsing {}", filename
.display());
39 eprintln
!("{}", e
.display_chain());
46 summary_md_test
!(rust_by_example
, "rust_by_example.md");
47 summary_md_test
!(rust_ffi_guide
, "rust_ffi_guide.md");
48 summary_md_test
!(example_book
, "example_book.md");
49 summary_md_test
!(the_book_2nd_edition
, "the_book-2nd_edition.md");