From d7ac0825e0759cde171670175a5e129ad1f2af10 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 16 Aug 2017 12:51:11 +0200 Subject: Add test for variable declaration --- testing/tests/vars.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'testing/tests') 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"); +} -- cgit