From: topecongiro Date: Fri, 9 Mar 2018 08:09:56 +0000 (+0900) Subject: Add a test for #2523 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=c3e76bc02cd131369029d082634a51b2d9893284;p=rust.git Add a test for #2523 --- diff --git a/tests/source/issue-2523.rs b/tests/source/issue-2523.rs new file mode 100644 index 00000000000..693d06e131a --- /dev/null +++ b/tests/source/issue-2523.rs @@ -0,0 +1,17 @@ +// rustfmt-normalize_comments: true + +// Do not unindent macro calls in comment with unformattable syntax. +//! ```rust +//! let x = 3 ; +//! some_macro!(pub fn fn foo() ( +//! println!("Don't unindent me!"); +//! )); +//! ``` + +// Format items that appear as arguments of macro call. +//! ```rust +//! let x = 3 ; +//! some_macro!(pub fn foo() { +//! println!("Don't unindent me!"); +//! }); +//! ``` diff --git a/tests/target/issue-2523.rs b/tests/target/issue-2523.rs new file mode 100644 index 00000000000..6805f7ec2ca --- /dev/null +++ b/tests/target/issue-2523.rs @@ -0,0 +1,17 @@ +// rustfmt-normalize_comments: true + +// Do not unindent macro calls in comment with unformattable syntax. +//! ```rust +//! let x = 3; +//! some_macro!(pub fn fn foo() ( +//! println!("Don't unindent me!"); +//! )); +//! ``` + +// Format items that appear as arguments of macro call. +//! ```rust +//! let x = 3; +//! some_macro!(pub fn foo() { +//! println!("Don't unindent me!"); +//! }); +//! ```