mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
rustdoc-json: Add test for keywords with --document-private-items
This commit is contained in:
parent
213ad10c8f
commit
3ee84983f1
20
tests/rustdoc-json/keyword_private.rs
Normal file
20
tests/rustdoc-json/keyword_private.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Ensure keyword docs are present with --document-private-items
|
||||
|
||||
//@ compile-flags: --document-private-items
|
||||
#![feature(rustdoc_internals)]
|
||||
|
||||
// @!has "$.index[*][?(@.name=='match')]"
|
||||
// @has "$.index[*][?(@.name=='foo')]"
|
||||
// @is "$.index[*][?(@.name=='foo')].attrs" '["#[doc(keyword = \"match\")]"]'
|
||||
// @is "$.index[*][?(@.name=='foo')].docs" '"this is a test!"'
|
||||
#[doc(keyword = "match")]
|
||||
/// this is a test!
|
||||
pub mod foo {}
|
||||
|
||||
// @!has "$.index[*][?(@.name=='hello')]"
|
||||
// @has "$.index[*][?(@.name=='bar')]"
|
||||
// @is "$.index[*][?(@.name=='bar')].attrs" '["#[doc(keyword = \"hello\")]"]'
|
||||
// @is "$.index[*][?(@.name=='bar')].docs" '"hello"'
|
||||
#[doc(keyword = "hello")]
|
||||
/// hello
|
||||
mod bar {}
|
Loading…
Reference in a new issue