mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-30 06:21:13 +00:00
Add test for let blocks
This commit is contained in:
parent
34fd0c07de
commit
fb11c175b2
1
testing/templates/let.html
Normal file
1
testing/templates/let.html
Normal file
@ -0,0 +1 @@
|
||||
{% let v = s %}{{ v }}
|
16
testing/tests/vars.rs
Normal file
16
testing/tests/vars.rs
Normal 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");
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user