Add test for duplicated macros in the sidebar

This commit is contained in:
Guillaume Gomez 2022-02-14 21:42:36 +01:00
parent bc4b0a774c
commit d9ea7bc98d
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,14 @@
// This test ensures that there is no macro duplicates in the sidebar.
goto: file://|DOC_PATH|/test_docs/macro.a.html
// Waiting for the elements in the sidebar to be rendered.
wait-for: ".sidebar-elems .others .macro"
// Check there is only one macro named "a" listed in the sidebar.
assert-count: (
"//*[@class='sidebar-elems']//*[@class='others']/*[@class='block macro']//li/a[text()='a']",
1,
)
// Check there is only one macro named "b" listed in the sidebar.
assert-count: (
"//*[@class='sidebar-elems']//*[@class='others']/*[@class='block macro']//li/a[text()='b']",
1,
)

View File

@ -271,3 +271,6 @@ impl EmptyTrait1 for HasEmptyTraits {}
impl EmptyTrait2 for HasEmptyTraits {}
#[doc(cfg(feature = "some-feature"))]
impl EmptyTrait3 for HasEmptyTraits {}
mod macros;
pub use macros::*;

View File

@ -0,0 +1,4 @@
#[macro_export]
macro_rules! a{ () => {}}
#[macro_export]
macro_rules! b{ () => {}}