Skip to content

Commit

Permalink
Add regression test.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabi-250 committed Nov 26, 2019
1 parent d2a271e commit 86a2b70
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/rewritable_units/document_end.rs
Expand Up @@ -111,4 +111,17 @@ mod tests {
);
}
}

#[test]
fn append_content_regression() {
// This prevents a regression where the output sink received an empty chunk
// before the end of the input stream.
for (html, enc) in encoded("") {
let output = rewrite_on_end(&html, enc, |end| {
end.append("<foo>", ContentType::Text);
});

assert_eq!(output, "&lt;foo&gt;");
}
}
}

0 comments on commit 86a2b70

Please sign in to comment.