mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Merge pull request #4429 from austinclem1/main
add missing indent when formatting single-quoted char in pattern
This commit is contained in:
commit
50d9755758
2 changed files with 12 additions and 0 deletions
|
@ -152,6 +152,7 @@ impl<'a> Formattable for Pattern<'a> {
|
|||
}
|
||||
StrLiteral(literal) => fmt_str_literal(buf, *literal, indent),
|
||||
SingleQuote(string) => {
|
||||
buf.indent(indent);
|
||||
buf.push('\'');
|
||||
buf.push_str(string);
|
||||
buf.push('\'');
|
||||
|
|
|
@ -3864,6 +3864,17 @@ mod test_fmt {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn when_with_single_quote_char() {
|
||||
expr_formats_same(indoc!(
|
||||
r#"
|
||||
when x is
|
||||
'0' -> 0
|
||||
'1' -> 1
|
||||
"#
|
||||
));
|
||||
}
|
||||
|
||||
// NEWLINES
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue