Add 'include-nest' test

This commit is contained in:
Kogia-sima 2020-06-07 00:49:50 +09:00
parent 7d77b755c6
commit 4b1fd92488
4 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,7 @@
1
2
INCLUDED: foo
3
4

View File

@ -0,0 +1,3 @@
1
<% include!("/includes/include-parent.stpl"); %>
4

View File

@ -0,0 +1,3 @@
2
<% include!("../included.stpl"); %>
3

View File

@ -84,3 +84,14 @@ struct Include<'a> {
fn test_include() {
assert_render("include", Include { strs: &["foo", "bar"] });
}
#[derive(TemplateOnce)]
#[template(path = "include-nest.stpl")]
struct IncludeNest<'a> {
s: &'a str,
}
#[test]
fn test_include_nest() {
assert_render("include-nest", IncludeNest { s: "foo" });
}