From 3ddafb2d7c96787e692e90c76f2ca5bdb936cb0c Mon Sep 17 00:00:00 2001 From: Smitty Date: Tue, 20 Apr 2021 19:53:44 -0400 Subject: Add test for title of root page in item-title.rs --- src/test/rustdoc/crate-title.rs | 3 --- src/test/rustdoc/item-title.rs | 34 ---------------------------------- src/test/rustdoc/title.rs | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 37 deletions(-) delete mode 100644 src/test/rustdoc/crate-title.rs delete mode 100644 src/test/rustdoc/item-title.rs create mode 100644 src/test/rustdoc/title.rs (limited to 'src/test') diff --git a/src/test/rustdoc/crate-title.rs b/src/test/rustdoc/crate-title.rs deleted file mode 100644 index 6f96f98e707..00000000000 --- a/src/test/rustdoc/crate-title.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/index.html '//head/title' 'foo - Rust' diff --git a/src/test/rustdoc/item-title.rs b/src/test/rustdoc/item-title.rs deleted file mode 100644 index 4c0d233fbec..00000000000 --- a/src/test/rustdoc/item-title.rs +++ /dev/null @@ -1,34 +0,0 @@ -#![crate_name = "foo"] -#![feature(doc_keyword)] - -// @has foo/fn.widget_count.html '//head/title' 'widget_count in foo - Rust' -/// blah -pub fn widget_count() {} - -// @has foo/struct.Widget.html '//head/title' 'Widget in foo - Rust' -pub struct Widget; - -// @has foo/constant.ANSWER.html '//head/title' 'ANSWER in foo - Rust' -pub const ANSWER: u8 = 42; - -// @has foo/blah/index.html '//head/title' 'foo::blah - Rust' -pub mod blah { - // @has foo/blah/struct.Widget.html '//head/title' 'Widget in foo::blah - Rust' - pub struct Widget; - - // @has foo/blah/trait.Awesome.html '//head/title' 'Awesome in foo::blah - Rust' - pub trait Awesome {} - - // @has foo/blah/fn.make_widget.html '//head/title' 'make_widget in foo::blah - Rust' - pub fn make_widget() {} - - // @has foo/macro.cool_macro.html '//head/title' 'cool_macro in foo - Rust' - #[macro_export] - macro_rules! cool_macro { - ($t:tt) => { $t } - } -} - -// @has foo/keyword.continue.html '//head/title' 'continue - Rust' -#[doc(keyword = "continue")] -mod continue_keyword {} diff --git a/src/test/rustdoc/title.rs b/src/test/rustdoc/title.rs new file mode 100644 index 00000000000..b0e22af0b1c --- /dev/null +++ b/src/test/rustdoc/title.rs @@ -0,0 +1,36 @@ +#![crate_name = "foo"] +#![feature(doc_keyword)] + +// @has foo/index.html '//head/title' 'foo - Rust' + +// @has foo/fn.widget_count.html '//head/title' 'widget_count in foo - Rust' +/// blah +pub fn widget_count() {} + +// @has foo/struct.Widget.html '//head/title' 'Widget in foo - Rust' +pub struct Widget; + +// @has foo/constant.ANSWER.html '//head/title' 'ANSWER in foo - Rust' +pub const ANSWER: u8 = 42; + +// @has foo/blah/index.html '//head/title' 'foo::blah - Rust' +pub mod blah { + // @has foo/blah/struct.Widget.html '//head/title' 'Widget in foo::blah - Rust' + pub struct Widget; + + // @has foo/blah/trait.Awesome.html '//head/title' 'Awesome in foo::blah - Rust' + pub trait Awesome {} + + // @has foo/blah/fn.make_widget.html '//head/title' 'make_widget in foo::blah - Rust' + pub fn make_widget() {} + + // @has foo/macro.cool_macro.html '//head/title' 'cool_macro in foo - Rust' + #[macro_export] + macro_rules! cool_macro { + ($t:tt) => { $t } + } +} + +// @has foo/keyword.continue.html '//head/title' 'continue - Rust' +#[doc(keyword = "continue")] +mod continue_keyword {} -- cgit 1.4.1-3-g733a5