add test ensuring only doc = "" attributes are normalized to comments

The other shapes of doc attributes shouldn't be normalized or modified.
This commit is contained in:
Rémy Rakic 2018-09-13 02:40:24 +02:00
parent cbc58410d9
commit 0c73b9414b
2 changed files with 14 additions and 0 deletions

View File

@ -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 }

View File

@ -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 {