summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc/mixing-doc-comments-and-attrs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc/mixing-doc-comments-and-attrs.rs')
-rw-r--r--tests/rustdoc/mixing-doc-comments-and-attrs.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/rustdoc/mixing-doc-comments-and-attrs.rs b/tests/rustdoc/mixing-doc-comments-and-attrs.rs
new file mode 100644
index 000000000..010058361
--- /dev/null
+++ b/tests/rustdoc/mixing-doc-comments-and-attrs.rs
@@ -0,0 +1,25 @@
+#![crate_name = "foo"]
+
+// @has 'foo/struct.S1.html'
+// @snapshot S1_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]'
+
+#[doc = "Hello world!\n\n"]
+/// Goodbye!
+#[doc = " Hello again!\n"]
+pub struct S1;
+
+// @has 'foo/struct.S2.html'
+// @snapshot S2_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]'
+
+/// Hello world!
+///
+#[doc = "Goodbye!"]
+/// Hello again!
+pub struct S2;
+
+// @has 'foo/struct.S3.html'
+// @snapshot S3_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]'
+/** Par 1
+*/ ///
+/// Par 2
+pub struct S3;