Skip to content

Commit 093633e

Browse files
committed
Update tests for #2438 and #2476
1 parent f094804 commit 093633e

File tree

2 files changed

+61
-7
lines changed

2 files changed

+61
-7
lines changed

rustfmt-core/tests/source/macro_rules.rs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// rustfmt-error_on_line_overflow: false
2+
13
macro_rules! m {
24
// a
35
($expr :expr, $( $func : ident ) * ) => {
@@ -50,12 +52,37 @@ macro m2 {
5052
}
5153
}
5254

53-
54-
// #2438
55+
// #2438, #2476
56+
macro_rules! m {
57+
() => {
58+
fn foo() {
59+
this_line_is_98_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
60+
);
61+
}
62+
}
63+
}
64+
macro_rules! m {
65+
() => {
66+
fn foo() {
67+
this_line_is_99_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
68+
);
69+
}
70+
};
71+
}
72+
macro_rules! m {
73+
() => {
74+
fn foo() {
75+
this_line_is_100_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
76+
);
77+
}
78+
};
79+
}
5580
macro_rules! m {
5681
() => {
57-
this_line_is_99_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
58-
); // this line is drifting
82+
fn foo() {
83+
this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
84+
);
85+
}
5986
};
6087
}
6188

rustfmt-core/tests/target/macro_rules.rs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// rustfmt-error_on_line_overflow: false
2+
13
macro_rules! m {
24
// a
35
($expr: expr, $($func: ident)*) => {{
@@ -42,11 +44,36 @@ macro m2 {
4244
}
4345
}
4446

45-
// #2438
47+
// #2438, #2476
4648
macro_rules! m {
4749
() => {
48-
this_line_is_99_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
49-
); // this line is drifting
50+
fn foo() {
51+
this_line_is_98_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx();
52+
}
53+
};
54+
}
55+
macro_rules! m {
56+
() => {
57+
fn foo() {
58+
this_line_is_99_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
59+
);
60+
}
61+
};
62+
}
63+
macro_rules! m {
64+
() => {
65+
fn foo() {
66+
this_line_is_100_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
67+
);
68+
}
69+
};
70+
}
71+
macro_rules! m {
72+
() => {
73+
fn foo() {
74+
this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
75+
);
76+
}
5077
};
5178
}
5279

0 commit comments

Comments
 (0)