Skip to content

Commit 3ee8498

Browse files
committed
rustdoc-json: Add test for keywords with --document-private-items
1 parent 213ad10 commit 3ee8498

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/rustdoc-json/keyword_private.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Ensure keyword docs are present with --document-private-items
2+
3+
//@ compile-flags: --document-private-items
4+
#![feature(rustdoc_internals)]
5+
6+
// @!has "$.index[*][?(@.name=='match')]"
7+
// @has "$.index[*][?(@.name=='foo')]"
8+
// @is "$.index[*][?(@.name=='foo')].attrs" '["#[doc(keyword = \"match\")]"]'
9+
// @is "$.index[*][?(@.name=='foo')].docs" '"this is a test!"'
10+
#[doc(keyword = "match")]
11+
/// this is a test!
12+
pub mod foo {}
13+
14+
// @!has "$.index[*][?(@.name=='hello')]"
15+
// @has "$.index[*][?(@.name=='bar')]"
16+
// @is "$.index[*][?(@.name=='bar')].attrs" '["#[doc(keyword = \"hello\")]"]'
17+
// @is "$.index[*][?(@.name=='bar')].docs" '"hello"'
18+
#[doc(keyword = "hello")]
19+
/// hello
20+
mod bar {}

0 commit comments

Comments
 (0)