diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index a2a1ebfb..9b8d3579 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -89,18 +89,6 @@ fn chapter_content_appears_in_rendered_document() { } } -/// Apply a series of predicates to some root predicate, where each -/// successive predicate is the descendant of the last one. Similar to how you -/// might do `ul.foo li a` in CSS to access all anchor tags in the `foo` list. -macro_rules! descendants { - ($root:expr, $($child:expr),*) => { - $root - $( - .descendant($child) - )* - }; -} - /// Make sure that all `*.md` files (excluding `SUMMARY.md`) were rendered /// and placed in the `book` directory with their extensions set to `*.html`. #[test] @@ -169,17 +157,6 @@ fn toc_fallback_html() -> Result { Ok(Document::from(html.as_str())) } -#[test] -fn check_spacers() { - let doc = toc_js_html().unwrap(); - let should_be = 2; - - let num_spacers = doc - .find(Class("chapter").descendant(Name("li").and(Class("spacer")))) - .count(); - assert_eq!(num_spacers, should_be); -} - // don't use target="_parent" in JS #[test] fn check_link_target_js() { diff --git a/tests/testsuite/toc.rs b/tests/testsuite/toc.rs index 38d4c4f9..3cc32e77 100644 --- a/tests/testsuite/toc.rs +++ b/tests/testsuite/toc.rs @@ -84,3 +84,14 @@ fn check_first_toc_level() { assert_eq!(children, should_be); } + +#[test] +fn check_spacers() { + let doc = toc_js_html(); + let should_be = 2; + + let num_spacers = doc + .find(Class("chapter").descendant(Name("li").and(Class("spacer")))) + .count(); + assert_eq!(num_spacers, should_be); +}