Skip to content

Commit 84bea05

Browse files
committed
Add tests
1 parent abf8f43 commit 84bea05

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// rustfmt-match_arm_forces_newline: true
2+
// rustfmt-wrap_match_arms: false
3+
4+
// match_arm_forces_newline puts all match arms bodies in a newline and indents
5+
// them.
6+
7+
fn main() {
8+
match x() {
9+
// a short non-empty block
10+
X0 => { f(); }
11+
// a long non-empty block
12+
X1 => { some.really.long.expression.fooooooooooooooooooooooooooooooooooooooooo().baaaaarrrrrrrrrrrrrrrrrrrrrrrrrr(); }
13+
// an empty block
14+
X2 => {}
15+
// a short non-block
16+
X3 => println!("ok"),
17+
// a long non-block
18+
X4 => foo.bar.baz.test.x.y.z.a.s.d.fasdfasdf.asfads.fasd.fasdfasdf.dfasfdsaf(),
19+
}
20+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// rustfmt-match_arm_forces_newline: true
2+
// rustfmt-wrap_match_arms: false
3+
4+
// match_arm_forces_newline puts all match arms bodies in a newline and indents
5+
// them.
6+
7+
fn main() {
8+
match x() {
9+
// a short non-empty block
10+
X0 => {
11+
f();
12+
}
13+
// a long non-empty block
14+
X1 => {
15+
some.really
16+
.long
17+
.expression
18+
.fooooooooooooooooooooooooooooooooooooooooo()
19+
.baaaaarrrrrrrrrrrrrrrrrrrrrrrrrr();
20+
}
21+
// an empty block
22+
X2 =>
23+
{}
24+
// a short non-block
25+
X3 =>
26+
println!("ok"),
27+
// a long non-block
28+
X4 =>
29+
foo.bar
30+
.baz
31+
.test
32+
.x
33+
.y
34+
.z
35+
.a
36+
.s
37+
.d
38+
.fasdfasdf
39+
.asfads
40+
.fasd
41+
.fasdfasdf
42+
.dfasfdsaf(),
43+
}
44+
}

0 commit comments

Comments
 (0)