diff --git a/integration-tests/templates/rm_whitespace.out b/integration-tests/templates/rm_whitespace.out new file mode 100644 index 0000000..90d3a36 --- /dev/null +++ b/integration-tests/templates/rm_whitespace.out @@ -0,0 +1,13 @@ +
+1 +2 +3 +
+
+trailing spaces +This line should be appeared under the previous line +
+
foo
+ +
bar
+ diff --git a/integration-tests/templates/rm_whitespace.stpl b/integration-tests/templates/rm_whitespace.stpl new file mode 100644 index 0000000..bfd3e3d --- /dev/null +++ b/integration-tests/templates/rm_whitespace.stpl @@ -0,0 +1,13 @@ +
+ 1 + 2 + + 3 +
+
+ trailing spaces + This line should be appeared under the previous line +
+<% for msg in messages { %> +
<%= msg %>
+<% } %> diff --git a/integration-tests/tests/basic.rs b/integration-tests/tests/basic.rs index 6f7471f..8d7f1e4 100644 --- a/integration-tests/tests/basic.rs +++ b/integration-tests/tests/basic.rs @@ -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::*;