Debian Codegraph @

tests/testsuite/print.rs

raw
1 //! Tests for print page.
2
3 use crate::prelude::*;
4 use snapbox::file;
5
6 // Tests relative links from the print page.
7 #[test]
8 fn relative_links() {
9 BookTest::from_dir("print/relative_links").check_main_file(
10 "book/print.html",
11 file!("print/relative_links/expected/print.html"),
12 );
13 }
14
15 // Test for duplicate IDs, and links to those duplicates.
16 #[test]
17 fn duplicate_ids() {
18 BookTest::from_dir("print/duplicate_ids").check_main_file(
19 "book/print.html",
20 file!("print/duplicate_ids/expected/print.html"),
21 );
22 }
23
24 // Test for synthesized link to a chapter that does not have an h1.
25 #[test]
26 fn chapter_no_h1() {
27 BookTest::from_dir("print/chapter_no_h1").check_main_file(
28 "book/print.html",
29 file!("print/chapter_no_h1/expected/print.html"),
30 );
31 }
32
33 // Checks that print.html is noindex.
34 #[test]
35 fn noindex() {
36 let robots = r#"<meta name="robots" content="noindex">"#;
37 BookTest::from_dir("print/noindex")
38 .check_file_contains("book/print.html", robots)
39 .check_file_doesnt_contain("book/index.html", robots);
40 }