Skip to content

Commit 0839d39

Browse files
Add regression test for multi-level import
1 parent 8c80fe7 commit 0839d39

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Diff for: src/test/rustdoc/multiple-import-levels.rs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// The goal of this test is to ensure that the attributes of all imports are taken into
2+
// account.
3+
4+
#![crate_name = "foo"]
5+
6+
mod a {
7+
/// 1
8+
pub struct Type;
9+
}
10+
11+
mod b {
12+
/// 2
13+
pub use crate::a::Type;
14+
}
15+
16+
mod c {
17+
/// 3
18+
pub use crate::b::Type;
19+
/// 4
20+
pub use crate::b::Type as Woof;
21+
}
22+
23+
// @has 'foo/struct.Type.html'
24+
// @has - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]' 'foo 2 1'
25+
/// foo
26+
pub use b::Type;
27+
// @has 'foo/struct.Whatever.html'
28+
// @has - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]' 'whatever 3 2 1'
29+
/// whatever
30+
pub use c::Type as Whatever;
31+
// @has 'foo/struct.Woof.html'
32+
// @has - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]' 'a dog 4 2 1'
33+
/// a dog
34+
pub use c::Woof;

0 commit comments

Comments
 (0)