Add test for let blocks

This commit is contained in:
Dirkjan Ochtman 2017-08-15 07:46:57 +02:00
parent 34fd0c07de
commit fb11c175b2
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1 @@
{% let v = s %}{{ v }}

16
testing/tests/vars.rs Normal file
View File

@ -0,0 +1,16 @@
#[macro_use]
extern crate askama;
use askama::Template;
#[derive(Template)]
#[template(path = "let.html")]
struct LetTemplate<'a> {
s: &'a str,
}
#[test]
fn test_let() {
let t = LetTemplate { s: "foo" };
assert_eq!(t.render().unwrap(), "foo");
}