From d3320d41f0d768f9badfe783090f210b06113f0e Mon Sep 17 00:00:00 2001 From: Kogia-sima Date: Sun, 7 Jun 2020 23:19:27 +0900 Subject: [PATCH] Add test for nested comment block --- integration-tests/templates/comment.out | 1 + integration-tests/templates/comment.stpl | 1 + integration-tests/tests/template_once.rs | 9 +++++++++ 3 files changed, 11 insertions(+) create mode 100644 integration-tests/templates/comment.out create mode 100644 integration-tests/templates/comment.stpl diff --git a/integration-tests/templates/comment.out b/integration-tests/templates/comment.out new file mode 100644 index 0000000..cc32087 --- /dev/null +++ b/integration-tests/templates/comment.out @@ -0,0 +1 @@ +10001 diff --git a/integration-tests/templates/comment.stpl b/integration-tests/templates/comment.stpl new file mode 100644 index 0000000..3bfb725 --- /dev/null +++ b/integration-tests/templates/comment.stpl @@ -0,0 +1 @@ +<%= 1 + /* 10 + %> /* 100 + */ 1000 %> + */ 10000 %> diff --git a/integration-tests/tests/template_once.rs b/integration-tests/tests/template_once.rs index f838ead..83a3e7a 100644 --- a/integration-tests/tests/template_once.rs +++ b/integration-tests/tests/template_once.rs @@ -164,6 +164,15 @@ fn test_rm_whitespace() { ); } +#[derive(TemplateOnce)] +#[template(path = "comment.stpl")] +struct Comment {} + +#[test] +fn test_comment() { + assert_render("comment", Comment{}) +} + #[cfg(unix)] mod unix { use super::*;