diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-21 22:53:50 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-21 22:54:16 +0200 |
| commit | 45fd4bc118267c2be23f6d843ad85432832048c4 (patch) | |
| tree | 3afca17e07d08a0abb75774ce26236b2cf672a78 /src/test | |
| parent | 4c88f0c63b54c406412e4c3309aea711309eb9ab (diff) | |
| download | rust-45fd4bc118267c2be23f6d843ad85432832048c4.tar.gz rust-45fd4bc118267c2be23f6d843ad85432832048c4.zip | |
Add test for search result keyword extra info
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc-gui/search-result-keyword.goml | 11 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/lib.rs | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/search-result-keyword.goml b/src/test/rustdoc-gui/search-result-keyword.goml new file mode 100644 index 00000000000..23552c8ce89 --- /dev/null +++ b/src/test/rustdoc-gui/search-result-keyword.goml @@ -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"}) diff --git a/src/test/rustdoc-gui/src/lib.rs b/src/test/rustdoc-gui/src/lib.rs index eeba3e3f907..7b247a19b8e 100644 --- a/src/test/rustdoc-gui/src/lib.rs +++ b/src/test/rustdoc-gui/src/lib.rs @@ -2,6 +2,7 @@ //! documentation generated so we can test each different features. #![crate_name = "test_docs"] +#![feature(doc_keyword)] use std::fmt; @@ -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 {} |
