Add test for submodules in inner crate

This commit is contained in:
Joshua Nelson 2020-06-09 20:12:01 -04:00
parent 9eb63945eb
commit 71fe8f7cd8
4 changed files with 20 additions and 3 deletions

View File

@ -0,0 +1,11 @@
#![crate_name = "a"]
pub mod bar {
pub struct Bar;
}
pub mod foo {
use crate::bar;
/// link to [bar::Bar]
pub struct Foo;
}

View File

@ -0,0 +1,6 @@
// aux-build:submodule-inner.rs
// build-aux-docs
extern crate a;
// @has 'submodule_inner/struct.Foo.html' '//a[@href="../a/bar/struct.Bar.html"]' 'Bar'
pub use a::foo::Foo;

View File

@ -1,4 +1,4 @@
// aux-build:submodule.rs
// aux-build:submodule-outer.rs
// edition:2018
extern crate bar as bar_;
@ -9,6 +9,6 @@ pub mod bar {
// NOTE: we re-exported both `Foo` and `Bar` here,
// NOTE: so they are inlined and therefore we link to the current module.
// @has 'submodule/trait.Foo.html' '//a[@href="../submodule/bar/trait.Bar.html"]' 'Bar'
// @has 'submodule/trait.Foo.html' '//a[@href="../submodule/trait.Baz.html"]' 'Baz'
// @has 'submodule_outer/trait.Foo.html' '//a[@href="../submodule_outer/bar/trait.Bar.html"]' 'Bar'
// @has 'submodule_outer/trait.Foo.html' '//a[@href="../submodule_outer/trait.Baz.html"]' 'Baz'
pub use ::bar_::{Foo, Baz};