Account for let_chains in collapsible_if ui test cases.

This commit is contained in:
Mazdak Farrokhzad 2019-05-21 08:17:47 +02:00
parent b918594369
commit 6ef8b57e34
2 changed files with 42 additions and 0 deletions

View File

@ -172,4 +172,25 @@ else {
println!("Hello world!");
}
}
// Test behavior wrt. `let_chains`.
// None of the cases below should be collapsed.
fn truth() -> bool { true }
// Prefix:
if let 0 = 1 {
if truth() {}
}
// Suffix:
if truth() {
if let 0 = 1 {}
}
// Midfix:
if truth() {
if let 0 = 1 {
if truth() {}
}
}
}

View File

@ -200,4 +200,25 @@ fn main() {
println!("Hello world!");
}
}
// Test behavior wrt. `let_chains`.
// None of the cases below should be collapsed.
fn truth() -> bool { true }
// Prefix:
if let 0 = 1 {
if truth() {}
}
// Suffix:
if truth() {
if let 0 = 1 {}
}
// Midfix:
if truth() {
if let 0 = 1 {
if truth() {}
}
}
}