Add rust_macro test

This commit is contained in:
Kogia-sima 2020-06-11 19:18:51 +09:00
parent 6dea4793ab
commit 0612a28c50
3 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Some

View File

@ -0,0 +1,5 @@
<% if matches!(value, Some(_)) { %>
Some
<% } else { %>
None
<% } %>

View File

@ -173,6 +173,17 @@ fn test_comment() {
assert_render("comment", Comment{})
}
#[derive(TemplateOnce)]
#[template(path = "rust_macro.stpl", rm_whitespace = true)]
struct RustMacro {
value: Option<i32>,
}
#[test]
fn test_rust_macro() {
assert_render("rust_macro", RustMacro { value: Some(10) });
}
#[cfg(unix)]
mod unix {
use super::*;