aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-04 21:38:59 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-04 21:38:59 +0100
commit4568c40ae4bd51258290a4b0da169b3d5bce9ee7 (patch)
tree464dedb49cba80f203666b8260f1542856559b56 /testing
parentd1d34ec6080697c47b6b548de15a0cbd55d68ead (diff)
downloadaskama-4568c40ae4bd51258290a4b0da169b3d5bce9ee7.tar.gz
askama-4568c40ae4bd51258290a4b0da169b3d5bce9ee7.tar.bz2
askama-4568c40ae4bd51258290a4b0da169b3d5bce9ee7.zip
Add test for == operator
Diffstat (limited to 'testing')
-rw-r--r--testing/templates/eq.html1
-rw-r--r--testing/tests/comparison.rs19
2 files changed, 20 insertions, 0 deletions
diff --git a/testing/templates/eq.html b/testing/templates/eq.html
new file mode 100644
index 0000000..44666d3
--- /dev/null
+++ b/testing/templates/eq.html
@@ -0,0 +1 @@
+{% if a == b %}t{% endif %}{% if a == c %}t{% else %}f{% endif %}
diff --git a/testing/tests/comparison.rs b/testing/tests/comparison.rs
new file mode 100644
index 0000000..2e34bc0
--- /dev/null
+++ b/testing/tests/comparison.rs
@@ -0,0 +1,19 @@
+extern crate askama;
+#[macro_use]
+extern crate askama_derive;
+
+use askama::Template;
+
+#[derive(Template)]
+#[template(path = "eq.html")]
+struct EqTemplate {
+ a: usize,
+ b: usize,
+ c: usize,
+}
+
+#[test]
+fn test_eq() {
+ let t = EqTemplate { a: 1, b: 1, c: 2 };
+ assert_eq!(t.render(), "tf\n");
+}