aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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");
+}