Fix top-level expect formatting bugs

This commit is contained in:
Richard Feldman 2022-08-04 23:05:54 -04:00
parent 862b58b8f9
commit a3e441c086
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -288,14 +288,18 @@ fn fmt_expect<'a, 'buf>(
is_multiline: bool,
indent: u16,
) {
buf.ensure_ends_with_newline();
buf.indent(indent);
buf.push_str("expect");
let return_indent = if is_multiline {
buf.newline();
indent + INDENT
} else {
buf.spaces(1);
indent
};
buf.ensure_ends_with_newline();
buf.push_str("expect");
condition.format(buf, return_indent);
}