tests: add tests for leading pipe config
This commit is contained in:
parent
146578c480
commit
4908ee19c3
27
tests/source/configs/match_arm_leading_pipes/always.rs
Normal file
27
tests/source/configs/match_arm_leading_pipes/always.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// rustfmt-match_arm_leading_pipes: Always
|
||||
|
||||
fn foo() {
|
||||
match foo {
|
||||
"foo" | "bar" => {}
|
||||
"baz"
|
||||
| "something relatively long"
|
||||
| "something really really really realllllllllllllly long" => println!("x"),
|
||||
"qux" => println!("y"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn issue_3973() {
|
||||
match foo {
|
||||
"foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
match baz {
|
||||
"qux" => {}
|
||||
"foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
28
tests/source/configs/match_arm_leading_pipes/never.rs
Normal file
28
tests/source/configs/match_arm_leading_pipes/never.rs
Normal file
@ -0,0 +1,28 @@
|
||||
// rustfmt-match_arm_leading_pipes: Never
|
||||
|
||||
fn foo() {
|
||||
match foo {
|
||||
| "foo" | "bar" => {}
|
||||
| "baz"
|
||||
| "something relatively long"
|
||||
| "something really really really realllllllllllllly long" => println!("x"),
|
||||
| "qux" => println!("y"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn issue_3973() {
|
||||
match foo {
|
||||
| "foo"
|
||||
| "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
match baz {
|
||||
"qux" => {}
|
||||
"foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
28
tests/source/configs/match_arm_leading_pipes/preserve.rs
Normal file
28
tests/source/configs/match_arm_leading_pipes/preserve.rs
Normal file
@ -0,0 +1,28 @@
|
||||
// rustfmt-match_arm_leading_pipes: Preserve
|
||||
|
||||
fn foo() {
|
||||
match foo {
|
||||
| "foo" | "bar" => {}
|
||||
| "baz"
|
||||
| "something relatively long"
|
||||
| "something really really really realllllllllllllly long" => println!("x"),
|
||||
| "qux" => println!("y"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn issue_3973() {
|
||||
match foo {
|
||||
| "foo"
|
||||
| "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
match baz {
|
||||
"qux" => { }
|
||||
"foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
27
tests/target/configs/match_arm_leading_pipes/always.rs
Normal file
27
tests/target/configs/match_arm_leading_pipes/always.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// rustfmt-match_arm_leading_pipes: Always
|
||||
|
||||
fn foo() {
|
||||
match foo {
|
||||
| "foo" | "bar" => {}
|
||||
| "baz"
|
||||
| "something relatively long"
|
||||
| "something really really really realllllllllllllly long" => println!("x"),
|
||||
| "qux" => println!("y"),
|
||||
| _ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn issue_3973() {
|
||||
match foo {
|
||||
| "foo" | "bar" => {}
|
||||
| _ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
match baz {
|
||||
| "qux" => {}
|
||||
| "foo" | "bar" => {}
|
||||
| _ => {}
|
||||
}
|
||||
}
|
27
tests/target/configs/match_arm_leading_pipes/never.rs
Normal file
27
tests/target/configs/match_arm_leading_pipes/never.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// rustfmt-match_arm_leading_pipes: Never
|
||||
|
||||
fn foo() {
|
||||
match foo {
|
||||
"foo" | "bar" => {}
|
||||
"baz"
|
||||
| "something relatively long"
|
||||
| "something really really really realllllllllllllly long" => println!("x"),
|
||||
"qux" => println!("y"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn issue_3973() {
|
||||
match foo {
|
||||
"foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
match baz {
|
||||
"qux" => {}
|
||||
"foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
27
tests/target/configs/match_arm_leading_pipes/preserve.rs
Normal file
27
tests/target/configs/match_arm_leading_pipes/preserve.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// rustfmt-match_arm_leading_pipes: Preserve
|
||||
|
||||
fn foo() {
|
||||
match foo {
|
||||
| "foo" | "bar" => {}
|
||||
| "baz"
|
||||
| "something relatively long"
|
||||
| "something really really really realllllllllllllly long" => println!("x"),
|
||||
| "qux" => println!("y"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn issue_3973() {
|
||||
match foo {
|
||||
| "foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
match baz {
|
||||
"qux" => {}
|
||||
"foo" | "bar" => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user