Add integration test for include!
This commit is contained in:
parent
c618f19cb6
commit
cd8e3d832a
|
@ -0,0 +1,7 @@
|
|||
|
||||
INCLUDED: foo
|
||||
|
||||
|
||||
INCLUDED: bar
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<% for s in strs { %>
|
||||
<% include!("included.stpl"); %>
|
||||
<% } %>
|
|
@ -0,0 +1 @@
|
|||
INCLUDED: <%= s %>
|
|
@ -73,3 +73,14 @@ struct CustomDelimiter;
|
|||
fn custom_delimiter() {
|
||||
assert_render("custom_delimiter", CustomDelimiter);
|
||||
}
|
||||
|
||||
#[derive(TemplateOnce)]
|
||||
#[template(path = "include.stpl")]
|
||||
struct Include<'a> {
|
||||
strs: &'a [&'a str],
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_include() {
|
||||
assert_render("include", Include { strs: &["foo", "bar"] });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue