//! Tests for the index preprocessor.
use crate::prelude::*;
// Checks basic README to index.html conversion.
#[test]
fn readme_to_index() {
let mut test = BookTest::from_dir("index/basic_readme");
test.check_main_file(
"book/index.html",
str![[r##"
"##]],
)
.check_main_file(
"book/first/index.html",
str![[r##""##]],
)
.check_main_file(
"book/second/index.html",
str![[r##""##]],
)
.check_toc_js(str![[r#"
-
Intro
-
1. First
-
2. Second
"#]]);
assert!(test.dir.join("book/index.html").exists());
assert!(!test.dir.join("book/README.html").exists());
}