aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/simple.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-01-07 22:23:01 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-01-07 22:23:01 +0100
commit01ca5d6c84770d82a1b20d792bb7e5441d92df44 (patch)
treeb6de11a5cf70f02a8f1b72aba9ca51f13f661ef9 /testing/tests/simple.rs
parentdf4220eb88aaec78c41df6d1b27216286ecd9b9e (diff)
downloadaskama-01ca5d6c84770d82a1b20d792bb7e5441d92df44.tar.gz
askama-01ca5d6c84770d82a1b20d792bb7e5441d92df44.tar.bz2
askama-01ca5d6c84770d82a1b20d792bb7e5441d92df44.zip
Add test for elif blocks
Diffstat (limited to 'testing/tests/simple.rs')
-rw-r--r--testing/tests/simple.rs14
1 files changed, 14 insertions, 0 deletions
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");
+}