Update rustdoc anonymous reexport test and add regression test for #108931
This commit is contained in:
parent
e8bd4ef1e5
commit
9b788da2da
2 changed files with 27 additions and 2 deletions
|
@ -4,9 +4,13 @@
|
||||||
|
|
||||||
// @has 'foo/index.html'
|
// @has 'foo/index.html'
|
||||||
// @has - '//*[@id="main-content"]' ''
|
// @has - '//*[@id="main-content"]' ''
|
||||||
// We check that the only "h2" present is for "Bla".
|
// We check that the only "h2" present are "Structs" (for "Bla") and "Re-exports".
|
||||||
// @count - '//*[@id="main-content"]/h2' 1
|
// @count - '//*[@id="main-content"]/h2' 2
|
||||||
// @has - '//*[@id="main-content"]/h2' 'Structs'
|
// @has - '//*[@id="main-content"]/h2' 'Structs'
|
||||||
|
// @has - '//*[@id="main-content"]/h2' 'Re-exports'
|
||||||
|
// The 3 re-exports.
|
||||||
|
// @count - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 3
|
||||||
|
// The public struct.
|
||||||
// @count - '//*[@id="main-content"]//a[@class="struct"]' 1
|
// @count - '//*[@id="main-content"]//a[@class="struct"]' 1
|
||||||
|
|
||||||
mod ext {
|
mod ext {
|
||||||
|
|
21
tests/rustdoc/issue-108931-anonymous-reexport.rs
Normal file
21
tests/rustdoc/issue-108931-anonymous-reexport.rs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// Ensuring that anonymous re-exports are always inlined.
|
||||||
|
|
||||||
|
#![crate_name = "foo"]
|
||||||
|
|
||||||
|
pub mod foo {
|
||||||
|
pub struct Foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
mod bar {
|
||||||
|
pub struct Bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @has 'foo/index.html'
|
||||||
|
// We check that the only "h2" present are "Re-exports" and "Modules".
|
||||||
|
// @count - '//*[@id="main-content"]/h2' 2
|
||||||
|
// @has - '//*[@id="main-content"]/h2' 'Re-exports'
|
||||||
|
// @has - '//*[@id="main-content"]/h2' 'Modules'
|
||||||
|
// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use foo::Foo as _;'
|
||||||
|
// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use bar::Bar as _;'
|
||||||
|
pub use foo::Foo as _;
|
||||||
|
pub use bar::Bar as _;
|
Loading…
Add table
Add a link
Reference in a new issue