about summary refs log tree commit diff
path: root/tests/rustdoc-json/keyword_private.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-json/keyword_private.rs')
-rw-r--r--tests/rustdoc-json/keyword_private.rs20
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 {}