mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-28 21:41:35 +00:00
18 lines
354 B
Rust
18 lines
354 B
Rust
#[macro_use]
|
|
extern crate askama;
|
|
|
|
use askama::Template;
|
|
|
|
#[derive(Template)]
|
|
#[template(path = "include.html")]
|
|
struct IncludeTemplate<'a> {
|
|
strs: &'a [&'a str],
|
|
}
|
|
|
|
#[test]
|
|
fn test_include() {
|
|
let strs = vec!["foo", "bar"];
|
|
let s = IncludeTemplate { strs: &strs };
|
|
assert_eq!(s.render().unwrap(), "\n INCLUDED: foo\n INCLUDED: bar")
|
|
}
|