Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,12 @@ a {
float: left;
}

tr.result span.primitive::after {
.result-name span.primitive::after {
content: ' (primitive type)';
font-style: italic;
}

tr.result span.keyword::after {
.result-name span.keyword::after {
content: ' (keyword)';
font-style: italic;
}
Expand Down
11 changes: 11 additions & 0 deletions src/test/rustdoc-gui/search-result-keyword.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
goto: file://|DOC_PATH|/test_docs/index.html
write: (".search-input", "CookieMonster")
// Waiting for the search results to appear...
wait-for: "#titles"
// Note: The two next assert commands could be merged as one but readability would be
// less good.
//
// Checking that the CSS is displaying " (keyword)"...
assert: (".result-name span.keyword::after", {"content": '" (keyword)"'})
// ... in italic.
assert: (".result-name span.keyword::after", {"font-style": "italic"})
4 changes: 4 additions & 0 deletions src/test/rustdoc-gui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//! documentation generated so we can test each different features.

#![crate_name = "test_docs"]
#![feature(doc_keyword)]

use std::fmt;

Expand Down Expand Up @@ -91,3 +92,6 @@ pub fn check_list_code_block() {}
pub enum AnEnum {
WithVariants { and: usize, sub: usize, variants: usize },
}

#[doc(keyword = "CookieMonster")]
pub mod keyword {}