Add tests
This commit is contained in:
parent
abf8f43233
commit
84bea05719
2 changed files with 64 additions and 0 deletions
20
tests/source/configs-match_arm_forces_newline-true.rs
Normal file
20
tests/source/configs-match_arm_forces_newline-true.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// rustfmt-match_arm_forces_newline: true
|
||||
// rustfmt-wrap_match_arms: false
|
||||
|
||||
// match_arm_forces_newline puts all match arms bodies in a newline and indents
|
||||
// them.
|
||||
|
||||
fn main() {
|
||||
match x() {
|
||||
// a short non-empty block
|
||||
X0 => { f(); }
|
||||
// a long non-empty block
|
||||
X1 => { some.really.long.expression.fooooooooooooooooooooooooooooooooooooooooo().baaaaarrrrrrrrrrrrrrrrrrrrrrrrrr(); }
|
||||
// an empty block
|
||||
X2 => {}
|
||||
// a short non-block
|
||||
X3 => println!("ok"),
|
||||
// a long non-block
|
||||
X4 => foo.bar.baz.test.x.y.z.a.s.d.fasdfasdf.asfads.fasd.fasdfasdf.dfasfdsaf(),
|
||||
}
|
||||
}
|
||||
44
tests/target/configs-match_arm_forces_newline-true.rs
Normal file
44
tests/target/configs-match_arm_forces_newline-true.rs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// rustfmt-match_arm_forces_newline: true
|
||||
// rustfmt-wrap_match_arms: false
|
||||
|
||||
// match_arm_forces_newline puts all match arms bodies in a newline and indents
|
||||
// them.
|
||||
|
||||
fn main() {
|
||||
match x() {
|
||||
// a short non-empty block
|
||||
X0 => {
|
||||
f();
|
||||
}
|
||||
// a long non-empty block
|
||||
X1 => {
|
||||
some.really
|
||||
.long
|
||||
.expression
|
||||
.fooooooooooooooooooooooooooooooooooooooooo()
|
||||
.baaaaarrrrrrrrrrrrrrrrrrrrrrrrrr();
|
||||
}
|
||||
// an empty block
|
||||
X2 =>
|
||||
{}
|
||||
// a short non-block
|
||||
X3 =>
|
||||
println!("ok"),
|
||||
// a long non-block
|
||||
X4 =>
|
||||
foo.bar
|
||||
.baz
|
||||
.test
|
||||
.x
|
||||
.y
|
||||
.z
|
||||
.a
|
||||
.s
|
||||
.d
|
||||
.fasdfasdf
|
||||
.asfads
|
||||
.fasd
|
||||
.fasdfasdf
|
||||
.dfasfdsaf(),
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue