about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRémy Rakic <remy.rakic@gmail.com>2018-09-13 02:40:24 +0200
committerRémy Rakic <remy.rakic@gmail.com>2018-09-13 02:40:24 +0200
commit0c73b9414bdfdc1f8d4d910bf2276e5ea9d2e9de (patch)
tree8e7838a1a0c181f14828ea50c85bc5c044c3a090
parentcbc58410d9577a49533a08b14a7a7e9227e37d5a (diff)
add test ensuring only doc = "" attributes are normalized to comments
The other shapes of doc attributes shouldn't be normalized or modified.
-rw-r--r--tests/source/doc-attrib.rs6
-rw-r--r--tests/target/doc-attrib.rs8
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/source/doc-attrib.rs b/tests/source/doc-attrib.rs
index 67caeff1d54..363e1441da3 100644
--- a/tests/source/doc-attrib.rs
+++ b/tests/source/doc-attrib.rs
@@ -1,7 +1,13 @@
 // rustfmt-wrap_comments: true
 // rustfmt-normalize_doc_attributes: true
 
+// Only doc = "" attributes should be normalized
 #![doc = "Example doc attribute comment"]
+#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
+       html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
+       html_root_url = "https://doc.rust-lang.org/nightly/",
+       html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))]
+
 
 // Long `#[doc = "..."]`
 struct A { #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 }
diff --git a/tests/target/doc-attrib.rs b/tests/target/doc-attrib.rs
index c672bc39c05..044e004decc 100644
--- a/tests/target/doc-attrib.rs
+++ b/tests/target/doc-attrib.rs
@@ -1,7 +1,15 @@
 // rustfmt-wrap_comments: true
 // rustfmt-normalize_doc_attributes: true
 
+// Only doc = "" attributes should be normalized
 //! Example doc attribute comment
+#![doc(
+    html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
+    html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
+    html_root_url = "https://doc.rust-lang.org/nightly/",
+    html_playground_url = "https://play.rust-lang.org/",
+    test(attr(deny(warnings)))
+)]
 
 // Long `#[doc = "..."]`
 struct A {