aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/vars.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-16 12:51:11 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-16 12:51:11 +0200
commitd7ac0825e0759cde171670175a5e129ad1f2af10 (patch)
treeabc8746d431fa6193a0347273ac7a52aecd022ff /testing/tests/vars.rs
parent05597b61daabfa1ab4c675c2943ceeefcb82db36 (diff)
downloadaskama-d7ac0825e0759cde171670175a5e129ad1f2af10.tar.gz
askama-d7ac0825e0759cde171670175a5e129ad1f2af10.tar.bz2
askama-d7ac0825e0759cde171670175a5e129ad1f2af10.zip
Add test for variable declaration
Diffstat (limited to 'testing/tests/vars.rs')
-rw-r--r--testing/tests/vars.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/tests/vars.rs b/testing/tests/vars.rs
index 53e3397..ab40665 100644
--- a/testing/tests/vars.rs
+++ b/testing/tests/vars.rs
@@ -14,3 +14,17 @@ fn test_let() {
let t = LetTemplate { s: "foo" };
assert_eq!(t.render().unwrap(), "foo");
}
+
+
+#[derive(Template)]
+#[template(path = "let-decl.html")]
+struct LetDeclTemplate<'a> {
+ cond: bool,
+ s: &'a str,
+}
+
+#[test]
+fn test_let_decl() {
+ let t = LetDeclTemplate { cond: false, s: "bar" };
+ assert_eq!(t.render().unwrap(), "bar");
+}