From 01ca5d6c84770d82a1b20d792bb7e5441d92df44 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sat, 7 Jan 2017 22:23:01 +0100 Subject: Add test for elif blocks --- testing/tests/simple.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'testing/tests') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 6515146..61f5fa4 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -52,3 +52,17 @@ fn test_else() { let s = ElseTemplate { cond: false }; assert_eq!(s.render(), "false\n"); } + + +#[derive(Template)] +#[template(path = "elif.html")] +struct ElIfTemplate { + cond: bool, + check: bool, +} + +#[test] +fn test_elif() { + let s = ElIfTemplate { cond: false, check: true }; + assert_eq!(s.render(), "checked\n"); +} -- cgit