mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Record Builder formatting
This commit is contained in:
parent
735721769c
commit
c2e50a22b6
4 changed files with 321 additions and 13 deletions
|
@ -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!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue