Skip to content

Commit 45fd4bc

Browse files
Add test for search result keyword extra info
1 parent 4c88f0c commit 45fd4bc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
goto: file://|DOC_PATH|/test_docs/index.html
2+
write: (".search-input", "CookieMonster")
3+
// Waiting for the search results to appear...
4+
wait-for: "#titles"
5+
// Note: The two next assert commands could be merged as one but readability would be
6+
// less good.
7+
//
8+
// Checking that the CSS is displaying " (keyword)"...
9+
assert: (".result-name span.keyword::after", {"content": '" (keyword)"'})
10+
// ... in italic.
11+
assert: (".result-name span.keyword::after", {"font-style": "italic"})

src/test/rustdoc-gui/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//! documentation generated so we can test each different features.
33
44
#![crate_name = "test_docs"]
5+
#![feature(doc_keyword)]
56

67
use std::fmt;
78

@@ -91,3 +92,6 @@ pub fn check_list_code_block() {}
9192
pub enum AnEnum {
9293
WithVariants { and: usize, sub: usize, variants: usize },
9394
}
95+
96+
#[doc(keyword = "CookieMonster")]
97+
pub mod keyword {}

0 commit comments

Comments
 (0)