Fix else/if formatter.
This commit is contained in:
@@ -173,6 +173,23 @@ fn test_format_nested_when() {
|
||||
assert_fmt(src, expected)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_format_else_if() {
|
||||
let src = indoc! {r#"
|
||||
pub fn foo(xs: List<a>, n: Int) -> List<a> {
|
||||
if n <= 0 {
|
||||
xs
|
||||
} else if n <= 10 {
|
||||
xs
|
||||
} else {
|
||||
xs
|
||||
}
|
||||
}
|
||||
"#};
|
||||
|
||||
assert_fmt(src, src)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_format_imports() {
|
||||
let src = indoc! {r#"
|
||||
|
||||
Reference in New Issue
Block a user