Skip to content

Commit

Permalink
Add tests for doc_keyword feature extension
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 27, 2020
1 parent f663093 commit af2040f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/rustdoc-ui/invalid-keyword.rs
@@ -0,0 +1,4 @@
#![feature(doc_keyword)]

#[doc(keyword = "foo df")] //~ ERROR
mod foo {}
8 changes: 8 additions & 0 deletions src/test/rustdoc-ui/invalid-keyword.stderr
@@ -0,0 +1,8 @@
error: `foo df` is not a valid identifier
--> $DIR/invalid-keyword.rs:3:17
|
LL | #[doc(keyword = "foo df")]
| ^^^^^^^^

error: aborting due to previous error

5 changes: 5 additions & 0 deletions src/test/rustdoc/keyword.rs
Expand Up @@ -14,3 +14,8 @@
#[doc(keyword = "match")]
/// this is a test!
mod foo{}

// @has foo/keyword.foo.html '//section[@id="main"]//div[@class="docblock"]//p' 'hello'
#[doc(keyword = "foo")]
/// hello
mod bar {}

0 comments on commit af2040f

Please sign in to comment.