diff options
| author | Alona Enraght-Moony <code@alona.page> | 2024-05-24 16:40:20 +0000 |
|---|---|---|
| committer | Alona Enraght-Moony <code@alona.page> | 2024-05-24 16:40:20 +0000 |
| commit | 3ee84983f1a0cf1fe0be0d0fb024be9e2eb6fd13 (patch) | |
| tree | 6337134be1ac3d6679b30eb9b577b3b0b0e5a697 | |
| parent | 213ad10c8f0fc275648552366275dc4e07f97462 (diff) | |
| download | rust-3ee84983f1a0cf1fe0be0d0fb024be9e2eb6fd13.tar.gz rust-3ee84983f1a0cf1fe0be0d0fb024be9e2eb6fd13.zip | |
rustdoc-json: Add test for keywords with `--document-private-items`
| -rw-r--r-- | tests/rustdoc-json/keyword_private.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/rustdoc-json/keyword_private.rs b/tests/rustdoc-json/keyword_private.rs new file mode 100644 index 00000000000..1c2b7d02155 --- /dev/null +++ b/tests/rustdoc-json/keyword_private.rs @@ -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 {} |
