Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for duplicated sidebar entries for reexported macro #90097

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/test/rustdoc-gui/sidebar-macro-reexport.goml
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 7 additions & 6 deletions src/test/rustdoc-gui/sidebar.goml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 7 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,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;