aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-01-07 22:12:52 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-01-07 22:12:52 +0100
commitc98297fe995d3a2e2d338208eb745b90533fdb3d (patch)
treea3e2144c4dd34a35c167411dbd36cd5be41fabd5 /testing/tests
parentf5ecfda679667c9f90a8819cd51a32dbdbec4189 (diff)
downloadaskama-c98297fe995d3a2e2d338208eb745b90533fdb3d.tar.gz
askama-c98297fe995d3a2e2d338208eb745b90533fdb3d.tar.bz2
askama-c98297fe995d3a2e2d338208eb745b90533fdb3d.zip
Add test for else blocks
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/simple.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index d17cae3..6515146 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -39,3 +39,16 @@ fn test_if() {
let s = IfTemplate { cond: true };
assert_eq!(s.render(), "true\n");
}
+
+
+#[derive(Template)]
+#[template(path = "else.html")]
+struct ElseTemplate {
+ cond: bool,
+}
+
+#[test]
+fn test_else() {
+ let s = ElseTemplate { cond: false };
+ assert_eq!(s.render(), "false\n");
+}