Add tests for invalid files generation
This commit is contained in:
parent
db95734b9d
commit
3ad595a316
23
tests/rustdoc/files-creation-hidden.rs
Normal file
23
tests/rustdoc/files-creation-hidden.rs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#![crate_name="foo"]
|
||||||
|
|
||||||
|
// @!has "foo/struct.Foo.html"
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub struct Foo;
|
||||||
|
|
||||||
|
// @!has "foo/struct.Bar.html"
|
||||||
|
pub use crate::Foo as Bar;
|
||||||
|
|
||||||
|
// @!has "foo/struct.Baz.html"
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use crate::Foo as Baz;
|
||||||
|
|
||||||
|
// @!has "foo/foo/index.html"
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub mod foo {}
|
||||||
|
|
||||||
|
// @!has "foo/bar/index.html"
|
||||||
|
pub use crate::foo as bar;
|
||||||
|
|
||||||
|
// @!has "foo/baz/index.html"
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use crate::foo as baz;
|
18
tests/rustdoc/files-creation-private.rs
Normal file
18
tests/rustdoc/files-creation-private.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#![crate_name="foo"]
|
||||||
|
|
||||||
|
// @!has "foo/priv/index.html"
|
||||||
|
// @!has "foo/priv/struct.Foo.html"
|
||||||
|
mod private {
|
||||||
|
pub struct Foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @has "foo/struct.Bar.html"
|
||||||
|
pub use crate::private::Foo as Bar;
|
||||||
|
|
||||||
|
// @!has "foo/foo/index.html"
|
||||||
|
mod foo {
|
||||||
|
pub mod subfoo {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @has "foo/bar/index.html"
|
||||||
|
pub use crate::foo::subfoo as bar;
|
@ -3,10 +3,10 @@
|
|||||||
#![crate_name = "foo"]
|
#![crate_name = "foo"]
|
||||||
|
|
||||||
// @!has 'foo/hidden/index.html'
|
// @!has 'foo/hidden/index.html'
|
||||||
// FIXME: add missing `@` for the two next tests once issue is fixed!
|
// @!has 'foo/hidden/inner/index.html'
|
||||||
// To be done in <https://github.com/rust-lang/rust/issues/111249>.
|
// FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249
|
||||||
// !has 'foo/hidden/inner/index.html'
|
// @has 'foo/hidden/inner/trait.Foo.html'
|
||||||
// !has 'foo/hidden/inner/trait.Foo.html'
|
// @matchesraw - '<meta http-equiv="refresh" content="0;URL=../../../foo/visible/trait.Foo.html">'
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub mod hidden {
|
pub mod hidden {
|
||||||
pub mod inner {
|
pub mod inner {
|
||||||
|
34
tests/rustdoc/issue-111249-file-creation.rs
Normal file
34
tests/rustdoc/issue-111249-file-creation.rs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#![crate_name = "foo"]
|
||||||
|
#![feature(no_core)]
|
||||||
|
#![no_core]
|
||||||
|
|
||||||
|
// The following five should not fail!
|
||||||
|
// @!has 'foo/hidden/index.html'
|
||||||
|
// @!has 'foo/hidden/inner/index.html'
|
||||||
|
// FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249
|
||||||
|
// @has 'foo/hidden/inner/trait.Foo.html'
|
||||||
|
// @matchesraw - '<meta http-equiv="refresh" content="0;URL=../../../foo/visible/trait.Foo.html">'
|
||||||
|
// @!has 'foo/hidden/inner/inner_hidden/index.html'
|
||||||
|
// @!has 'foo/hidden/inner/inner_hidden/trait.HiddenFoo.html'
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub mod hidden {
|
||||||
|
pub mod inner {
|
||||||
|
pub trait Foo {}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub mod inner_hidden {
|
||||||
|
pub trait HiddenFoo {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @has 'foo/visible/index.html'
|
||||||
|
// @has 'foo/visible/trait.Foo.html'
|
||||||
|
#[doc(inline)]
|
||||||
|
pub use hidden::inner as visible;
|
||||||
|
|
||||||
|
// @has 'foo/struct.Bar.html'
|
||||||
|
// @count - '//*[@id="impl-Foo-for-Bar"]' 1
|
||||||
|
pub struct Bar;
|
||||||
|
|
||||||
|
impl visible::Foo for Bar {}
|
@ -10,7 +10,9 @@ pub trait Foo {}
|
|||||||
// @has - '//code' 'pub use reexp_stripped::Bar'
|
// @has - '//code' 'pub use reexp_stripped::Bar'
|
||||||
// @has - '//code/a' 'Bar'
|
// @has - '//code/a' 'Bar'
|
||||||
// @has - '//a[@href="../reexp_stripped/hidden/struct.Bar.html"]' 'Bar'
|
// @has - '//a[@href="../reexp_stripped/hidden/struct.Bar.html"]' 'Bar'
|
||||||
|
// FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249
|
||||||
// @has reexp_stripped/hidden/struct.Bar.html
|
// @has reexp_stripped/hidden/struct.Bar.html
|
||||||
|
// @matchesraw - '<meta http-equiv="refresh" content="0;URL=../../reexp_stripped/struct.Bar.html">'
|
||||||
// @has 'reexp_stripped/struct.Bar.html'
|
// @has 'reexp_stripped/struct.Bar.html'
|
||||||
// @has - '//a[@href="struct.Bar.html"]' 'Bar'
|
// @has - '//a[@href="struct.Bar.html"]' 'Bar'
|
||||||
#[doc(no_inline)]
|
#[doc(no_inline)]
|
||||||
|
Loading…
Reference in New Issue
Block a user