Skip to content

Commit 20dd1bd

Browse files
Add test to ensure there are no duplicated imports
1 parent 4aa142e commit 20dd1bd

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// This test ensures that there are 4 imports as expected:
2+
// * 2 for `Foo`
3+
// * 2 for `Bar`
4+
5+
#![crate_name = "foo"]
6+
7+
// @has 'foo/index.html'
8+
9+
pub mod nested {
10+
/// Foo the struct
11+
pub struct Foo {}
12+
13+
#[allow(non_snake_case)]
14+
/// Foo the function
15+
pub fn Foo() {}
16+
}
17+
18+
// @count - '//*[@id="main-content"]//code' 'pub use nested::Foo;' 2
19+
// @has - '//*[@id="reexport.Foo"]//a[@href="nested/struct.Foo.html"]' 'Foo'
20+
// @has - '//*[@id="reexport.Foo-1"]//a[@href="nested/fn.Foo.html"]' 'Foo'
21+
pub use nested::Foo;
22+
23+
// @count - '//*[@id="main-content"]//code' 'pub use Foo as Bar;' 2
24+
// @has - '//*[@id="reexport.Bar"]//a[@href="nested/struct.Foo.html"]' 'Foo'
25+
// @has - '//*[@id="reexport.Bar-1"]//a[@href="nested/fn.Foo.html"]' 'Foo'
26+
pub use Foo as Bar;

0 commit comments

Comments
 (0)