add some tests.... and fix some bugs!

This commit is contained in:
Sébastien Besnier 2020-11-14 18:51:43 +01:00
parent 2000948765
commit 6be94c5f29
3 changed files with 40 additions and 17 deletions

View file

@ -107,18 +107,14 @@ where
match space {
Newline => {}
LineComment(comment) => {
newline(buf, indent);
buf.push('#');
buf.push_str(comment);
if let Some(true) = iter.peek().map(|s| s.is_comment()) {
newline(buf, indent);
}
}
DocComment(docs) => {
newline(buf, indent);
buf.push_str("##");
buf.push_str(docs);
if let Some(true) = iter.peek().map(|s| s.is_comment()) {
newline(buf, indent);
}
}
}
}