aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-01-07 21:04:03 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-01-07 21:04:03 +0100
commit73a048459da99270b3a35672cf64c77db706a226 (patch)
treea7ea46aed4de9623e14f1c1b3a4d0cd42d7b1bc8 /testing/tests
parentce9747c39c7523fbefe3700fbba93a6ac0c5341a (diff)
downloadaskama-73a048459da99270b3a35672cf64c77db706a226.tar.gz
askama-73a048459da99270b3a35672cf64c77db706a226.tar.bz2
askama-73a048459da99270b3a35672cf64c77db706a226.zip
Add test for simple if-blocks
Diffstat (limited to '')
-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 c287c5f..d17cae3 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -26,3 +26,16 @@ fn test_variables() {
Iñtërnâtiônàlizætiøn is important\n\
in vars too: Iñtërnâtiônàlizætiøn\n");
}
+
+
+#[derive(Template)]
+#[template(path = "if.html")]
+struct IfTemplate {
+ cond: bool,
+}
+
+#[test]
+fn test_if() {
+ let s = IfTemplate { cond: true };
+ assert_eq!(s.render(), "true\n");
+}