Add fmt test to make sure formatting works for all parser test cases

This commit is contained in:
Joshua Warner 2022-11-11 15:56:50 -05:00
parent 492eb31a3d
commit 1efd7260de
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 70 additions and 23 deletions

View file

@ -109,7 +109,7 @@ impl<'a> Buf<'a> {
if self.spaces_to_flush > 0 {
self.flush_spaces();
self.newline();
} else if !self.text.ends_with('\n') {
} else if !self.text.ends_with('\n') && !self.text.is_empty() {
self.newline()
}
}