Skip to content

Commit 7aebfa5

Browse files
authored
Rollup merge of rust-lang#97502 - onlineSoftwareDevOK:rustdocTests, r=GuillaumeGomez
rustdoc: Add more test coverage Related issue rust-lang#91113
2 parents daa6b17 + 9292c90 commit 7aebfa5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/test/rustdoc/nested-modules.rs

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#![crate_name = "aCrate"]
2+
3+
mod a_module {
4+
pub fn private_function() {}
5+
6+
pub use a_module::private_function as other_private_function;
7+
8+
pub mod a_nested_module {
9+
// @has aCrate/a_nested_module/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function'
10+
// @has aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
11+
pub fn a_nested_public_function() {}
12+
13+
// @has aCrate/a_nested_module/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function'
14+
// @has aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
15+
pub use a_nested_module::a_nested_public_function as another_nested_public_function;
16+
}
17+
18+
// @!has aCrate/a_nested_module/index.html 'yet_another_nested_public_function'
19+
pub use a_nested_module::a_nested_public_function as yet_another_nested_public_function;
20+
21+
// @!has aCrate/a_nested_module/index.html 'one_last_nested_public_function'
22+
pub use a_nested_module::another_nested_public_function as one_last_nested_public_function;
23+
}
24+
25+
// @!has aCrate/index.html 'a_module'
26+
// @has aCrate/index.html '//a[@href="a_nested_module/index.html"]' 'a_nested_module'
27+
pub use a_module::a_nested_module;
28+
29+
// @has aCrate/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function'
30+
// @has aCrate/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function'
31+
// @has aCrate/index.html '//a[@href="fn.yet_another_nested_public_function.html"]' 'yet_another_nested_public_function'
32+
// @has aCrate/index.html '//a[@href="fn.one_last_nested_public_function.html"]' 'one_last_nested_public_function'
33+
pub use a_module::{
34+
a_nested_module::{a_nested_public_function, another_nested_public_function},
35+
one_last_nested_public_function, yet_another_nested_public_function,
36+
};
37+
38+
// @has aCrate/index.html '//a[@href="fn.private_function.html"]' 'private_function'
39+
// @!has aCrate/fn.private_function.html 'a_module'
40+
// @has aCrate/index.html '//a[@href="fn.other_private_function.html"]' 'other_private_function'
41+
// @!has aCrate/fn.other_private_function.html 'a_module'
42+
pub use a_module::{other_private_function, private_function};

0 commit comments

Comments
 (0)