Add test for rm_whitespace option

This commit is contained in:
Kogia-sima 2020-06-07 07:19:42 +09:00
parent 61ff466976
commit 7324165ab0
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,13 @@
<div>
<span>1</span>
<span>2</span>
<span>3</span>
</div>
<div>
trailing spaces
This line should be appeared under the previous line
</div>
<div>foo</div>
<div>bar</div>

View File

@ -0,0 +1,13 @@
<div>
<span>1</span>
<span>2</span>
<span>3</span>
</div>
<div>
trailing spaces
This line should be appeared under the previous line
</div>
<% for msg in messages { %>
<div><%= msg %></div>
<% } %>

View File

@ -142,6 +142,18 @@ fn test_teams() {
assert_render("teams", teams);
}
#[derive(TemplateOnce)]
#[template(path = "rm_whitespace.stpl")]
#[template(rm_whitespace = true)]
struct RmWhitespace<'a, 'b> {
messages: &'a [&'b str],
}
#[test]
fn test_rm_whitespace() {
assert_render("rm_whitespace", RmWhitespace { messages: &["foo", "bar"] });
}
#[cfg(unix)]
mod unix {
use super::*;