diff --git a/src/test/rustdoc/infinite-redirection.rs b/src/test/rustdoc/infinite-redirection.rs new file mode 100644 index 0000000000000..96a43323ce29d --- /dev/null +++ b/src/test/rustdoc/infinite-redirection.rs @@ -0,0 +1,29 @@ +#![crate_name = "foo"] + +// This test ensures that there is no "infinite redirection" file generated (a +// file which redirects to itself). + +// We check it's not a redirection file. +// @has 'foo/builders/struct.ActionRowBuilder.html' +// @has - '//*[@id="synthetic-implementations"]' 'Auto Trait Implementations' + +// And that the link in the module is targetting it. +// @has 'foo/builders/index.html' +// @has - '//a[@href="struct.ActionRowBuilder.html"]' 'ActionRowBuilder' + +mod auto { + mod action_row { + pub struct ActionRowBuilder; + } + + #[doc(hidden)] + pub mod builders { + pub use super::action_row::ActionRowBuilder; + } +} + +pub use auto::*; + +pub mod builders { + pub use crate::auto::builders::*; +}