Add tests for doc_keyword feature extension
This commit is contained in:
parent
f663093222
commit
af2040ff95
3 changed files with 17 additions and 0 deletions
4
src/test/rustdoc-ui/invalid-keyword.rs
Normal file
4
src/test/rustdoc-ui/invalid-keyword.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
#![feature(doc_keyword)]
|
||||
|
||||
#[doc(keyword = "foo df")] //~ ERROR
|
||||
mod foo {}
|
8
src/test/rustdoc-ui/invalid-keyword.stderr
Normal file
8
src/test/rustdoc-ui/invalid-keyword.stderr
Normal file
|
@ -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
|
||||
|
|
@ -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 {}
|
||||
|
|
Loading…
Add table
Reference in a new issue