Record Builder formatting

This commit is contained in:
Agustin Zubiaga 2023-05-07 15:51:08 -03:00
parent 735721769c
commit c2e50a22b6
4 changed files with 321 additions and 13 deletions

View file

@ -1926,6 +1926,58 @@ mod test_fmt {
);
}
#[test]
fn record_builder() {
expr_formats_same(indoc!(
r#"
{ a: 1, b <- get "b" |> batch, c <- get "c" |> batch, d }
"#
));
expr_formats_to(
indoc!(
r#"
{ a: 1, b <- get "b" |> batch, c <- get "c" |> batch }
"#
),
indoc!(
r#"
{ a: 1, b <- get "b" |> batch, c <- get "c" |> batch }
"#
),
);
expr_formats_same(indoc!(
r#"
{
a: 1,
b <- get "b" |> batch,
c <- get "c" |> batch,
d,
}
"#
));
expr_formats_to(
indoc!(
r#"
{ a: 1, b <- get "b" |> batch,
c <- get "c" |> batch, d }
"#
),
indoc!(
r#"
{
a: 1,
b <- get "b" |> batch,
c <- get "c" |> batch,
d,
}
"#
),
);
}
#[test]
fn final_comments_in_records() {
expr_formats_same(indoc!(