Outdentable record builders

This commit is contained in:
Agustin Zubiaga 2023-05-17 12:20:45 -03:00
parent b92c50c7be
commit 5edcb31f32
No known key found for this signature in database
2 changed files with 34 additions and 7 deletions

View file

@ -1979,20 +1979,40 @@ mod test_fmt {
}
#[test]
fn multiline_record_builder_func_arg() {
fn outdentable_record_builders() {
expr_formats_to(
indoc!(
r#"
succeed { a: get "a" |> batch,
b: get "b" |> batch,
succeed { a: <- get "a" |> batch,
b: <- get "b" |> batch,
}
"#
),
indoc!(
r#"
succeed {
a: get "a" |> batch,
b: get "b" |> batch,
a: <- get "a" |> batch,
b: <- get "b" |> batch,
}
"#
),
);
expr_formats_to(
indoc!(
r#"
succeed
{
a: <- get "a" |> batch,
b: <- get "b" |> batch,
}
"#
),
indoc!(
r#"
succeed {
a: <- get "a" |> batch,
b: <- get "b" |> batch,
}
"#
),