Format apply funcs with try suffix correctly

This commit is contained in:
Anthony Bullard 2025-01-28 21:00:30 -06:00
parent 90db3b2db0
commit eb9d1bcf09
No known key found for this signature in database
2 changed files with 75 additions and 3 deletions

View file

@ -5602,6 +5602,30 @@ mod test_fmt {
);
}
#[test]
fn pnc_apply_with_try_suffix_after_fn() {
expr_formats_to_with_flags(
indoc!("some_fn?(arg1, arg2)"),
indoc!("some_fn(arg1, arg2)?"),
MigrationFlags {
snakify: true,
parens_and_commas: true,
},
);
}
#[test]
fn ws_apply_with_try_suffix_after_fn() {
expr_formats_to_with_flags(
indoc!("some_fn? arg1 arg2"),
indoc!("some_fn(arg1, arg2)?"),
MigrationFlags {
snakify: true,
parens_and_commas: true,
},
);
}
#[test]
fn func_call_trailing_multiline_lambda() {
// New syntax