Skip to content

Commit

Permalink
Add test for issue 3987
Browse files Browse the repository at this point in the history
Closes 3987

It's unclear which commit resolved this issue, but it can no longer be
reproduced.
  • Loading branch information
ytmimi authored and calebcartwright committed Jul 29, 2022
1 parent 7432422 commit a7801aa
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/source/issue-3987/format_macro_bodies_true.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// rustfmt-format_macro_bodies: true

// with comments
macro_rules! macros {
() => {{
Struct {
field: (
42 + //comment 1
42
//comment 2
),
};
}};
}

// without comments
macro_rules! macros {
() => {{
Struct {
field: (
42 +
42
),
};
}};
}
26 changes: 26 additions & 0 deletions tests/target/issue-3987/format_macro_bodies_false.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// rustfmt-format_macro_bodies: false

// with comments
macro_rules! macros {
() => {{
Struct {
field: (
42 + //comment 1
42
//comment 2
),
};
}};
}

// without comments
macro_rules! macros {
() => {{
Struct {
field: (
42 +
42
),
};
}};
}
21 changes: 21 additions & 0 deletions tests/target/issue-3987/format_macro_bodies_true.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// rustfmt-format_macro_bodies: true

// with comments
macro_rules! macros {
() => {{
Struct {
field: (
42 + //comment 1
42
//comment 2
),
};
}};
}

// without comments
macro_rules! macros {
() => {{
Struct { field: (42 + 42) };
}};
}

0 comments on commit a7801aa

Please sign in to comment.