Fix else/if formatter.

This commit is contained in:
KtorZ
2022-12-28 17:55:11 +01:00
parent bae8267f18
commit f2e716dd86
2 changed files with 20 additions and 3 deletions

View File

@@ -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#"