Skip to content

Commit 3330e67

Browse files
committed
Add tests that include comments before the overflow-able params
1 parent 9784337 commit 3330e67

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

tests/source/expr-overflow-delimited.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ fn combine_blocklike() {
1717
);
1818

1919
do_thing(
20+
x,
21+
22+
// I'll be discussing the `action` with your para(m)legal counsel
23+
|param| {
24+
action();
25+
foo(param)
26+
},
27+
);
28+
29+
do_thing(
30+
Bar {
31+
x: value,
32+
y: value2,
33+
},
34+
);
35+
36+
do_thing(
37+
x,
2038
Bar {
2139
x: value,
2240
y: value2,
@@ -25,6 +43,8 @@ fn combine_blocklike() {
2543

2644
do_thing(
2745
x,
46+
47+
// Let me tell you about that one time at the `Bar`
2848
Bar {
2949
x: value,
3050
y: value2,
@@ -51,6 +71,28 @@ fn combine_blocklike() {
5171
);
5272

5373
do_thing(
74+
x,
75+
76+
// Just admit it; my list is longer than can be folded on to one line
77+
&[
78+
value_with_longer_name,
79+
value2_with_longer_name,
80+
value3_with_longer_name,
81+
value4_with_longer_name,
82+
],
83+
);
84+
85+
do_thing(
86+
vec![
87+
value_with_longer_name,
88+
value2_with_longer_name,
89+
value3_with_longer_name,
90+
value4_with_longer_name,
91+
],
92+
);
93+
94+
do_thing(
95+
x,
5496
vec![
5597
value_with_longer_name,
5698
value2_with_longer_name,
@@ -61,6 +103,8 @@ fn combine_blocklike() {
61103

62104
do_thing(
63105
x,
106+
107+
// Just admit it; my list is longer than can be folded on to one line
64108
vec![
65109
value_with_longer_name,
66110
value2_with_longer_name,

tests/target/expr-overflow-delimited.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ fn combine_blocklike() {
1111
foo(param)
1212
});
1313

14+
do_thing(
15+
x,
16+
// I'll be discussing the `action` with your para(m)legal counsel
17+
|param| {
18+
action();
19+
foo(param)
20+
},
21+
);
22+
1423
do_thing(Bar {
1524
x: value,
1625
y: value2,
@@ -21,6 +30,15 @@ fn combine_blocklike() {
2130
y: value2,
2231
});
2332

33+
do_thing(
34+
x,
35+
// Let me tell you about that one time at the `Bar`
36+
Bar {
37+
x: value,
38+
y: value2,
39+
},
40+
);
41+
2442
do_thing(&[
2543
value_with_longer_name,
2644
value2_with_longer_name,
@@ -35,6 +53,17 @@ fn combine_blocklike() {
3553
value4_with_longer_name,
3654
]);
3755

56+
do_thing(
57+
x,
58+
// Just admit it; my list is longer than can be folded on to one line
59+
&[
60+
value_with_longer_name,
61+
value2_with_longer_name,
62+
value3_with_longer_name,
63+
value4_with_longer_name,
64+
],
65+
);
66+
3867
do_thing(vec![
3968
value_with_longer_name,
4069
value2_with_longer_name,
@@ -49,6 +78,17 @@ fn combine_blocklike() {
4978
value4_with_longer_name,
5079
]);
5180

81+
do_thing(
82+
x,
83+
// Just admit it; my list is longer than can be folded on to one line
84+
vec![
85+
value_with_longer_name,
86+
value2_with_longer_name,
87+
value3_with_longer_name,
88+
value4_with_longer_name,
89+
],
90+
);
91+
5292
do_thing(
5393
x,
5494
(1, 2, 3, |param| {

0 commit comments

Comments
 (0)