Rollup merge of #90097 - GuillaumeGomez:duplicated-sidebar-entry-reexported-macro, r=notriddle

Add test for duplicated sidebar entries for reexported macro

Fixes #90015.

r? ````@notriddle````
This commit is contained in:
Yuki Okushi 2021-10-21 14:11:11 +09:00 committed by GitHub
commit 759a8aee31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 6 deletions

View File

@ -0,0 +1,5 @@
// This test ensures that the reexport of a macro doesn't make the original macro
// displayed twice in the sidebar.
goto: file://|DOC_PATH|/test_docs/macro.repro.html
wait-for: ".sidebar-elems .macro .macro"
assert-count: ("//*[@class='sidebar-elems']//*[@class='block macro']//a[text()='repro']", 1)

View File

@ -7,12 +7,13 @@ assert-text: (".sidebar-elems > #all-types", "See all test_docs's items")
assert-text: (".sidebar-elems > .crate > ul > li > a.current", "test_docs")
// And we're also supposed to have the list of items in the current module.
assert-text: (".sidebar-elems > .items > ul > li:nth-child(1)", "Modules")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Structs")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Enums")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Traits")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Functions")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(6)", "Type Definitions")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(7)", "Keywords")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(2)", "Macros")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(3)", "Structs")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(4)", "Enums")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(5)", "Traits")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(6)", "Functions")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(7)", "Type Definitions")
assert-text: (".sidebar-elems > .items > ul > li:nth-child(8)", "Keywords")
assert-text: ("#structs + .item-table .item-left > a", "Foo")
click: "#structs + .item-table .item-left > a"

View File

@ -124,3 +124,10 @@ pub mod huge_amount_of_consts {
/// Very long code text `hereIgoWithLongTextBecauseWhyNotAndWhyWouldntI`.
pub mod long_code_block {}
#[macro_export]
macro_rules! repro {
() => {};
}
pub use crate::repro as repro2;