diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index 0a151a54..46e770f9 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -127,20 +127,6 @@ fn rendered_code_does_not_have_playground_stuff_in_html_when_disabled_in_config( assert_doesnt_contain_strings(nested, &playground_class); } -#[test] -fn anchors_include_text_between_but_not_anchor_comments() { - let temp = DummyBook::new().build().unwrap(); - let md = MDBook::load(temp.path()).unwrap(); - md.build().unwrap(); - - let nested = temp.path().join("book/first/nested.html"); - let text_between_anchors = vec!["unique-string-for-anchor-test"]; - let anchor_text = vec!["ANCHOR"]; - - assert_contains_strings(nested.clone(), &text_between_anchors); - assert_doesnt_contain_strings(nested, &anchor_text); -} - #[test] fn rustdoc_include_hides_the_unspecified_part_of_the_file() { let temp = DummyBook::new().build().unwrap(); diff --git a/tests/testsuite/includes.rs b/tests/testsuite/includes.rs index 1e4a7c53..f1aca1f0 100644 --- a/tests/testsuite/includes.rs +++ b/tests/testsuite/includes.rs @@ -23,3 +23,18 @@ fn include() { "##]], ); } + +// Checks for anchored includes. +#[test] +fn anchored_include() { + BookTest::from_dir("includes/all_includes").check_main_file( + "book/anchors.html", + str![[r##" +

Include Anchors

+
#![allow(unused)]
+fn main() {
+let x = 1;
+}
+"##]], + ); +}