Skip to content

Commit

Permalink
Add test for duplicated macros in the sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 14, 2022
1 parent bc4b0a7 commit d9ea7bc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/rustdoc-gui/duplicate-macro-reexport.goml
Original file line number Diff line number Diff line change
@@ -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,
)
3 changes: 3 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
4 changes: 4 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/macros.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[macro_export]
macro_rules! a{ () => {}}
#[macro_export]
macro_rules! b{ () => {}}

0 comments on commit d9ea7bc

Please sign in to comment.