fix: add spaces around ? in optional record field

This commit is contained in:
Luca Cervello 2023-02-08 18:41:22 +01:00
parent 9340a67e87
commit a4410fe052
No known key found for this signature in database
GPG key ID: 05180DD59F7580C4
3 changed files with 39 additions and 1 deletions

View file

@ -2164,6 +2164,43 @@ mod test_fmt {
);
}
#[test]
fn type_definition_add_space_around_optional_record() {
expr_formats_to(
indoc!(
r#"
f : { a ?Str }
f"#
),
indoc!(
r#"
f : { a ? Str }
f"#
),
);
expr_formats_to(
indoc!(
r#"
f : {
a ?Str,
}
f"#
),
indoc!(
r#"
f : {
a ? Str,
}
f"#
),
);
}
#[test]
#[ignore]
fn final_comment_in_empty_record_type_definition() {