aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-10-04 21:09:02 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-10-04 21:09:02 +0200
commit4bd89aa6936b343d53968fb1d4d1960140b13b67 (patch)
treed731e707d1a377ce30063975ad0215576eb633d5
parentd497a31e059292f7b37b46c6f17b489e9f3623b0 (diff)
downloadaskama-4bd89aa6936b343d53968fb1d4d1960140b13b67.tar.gz
askama-4bd89aa6936b343d53968fb1d4d1960140b13b67.tar.bz2
askama-4bd89aa6936b343d53968fb1d4d1960140b13b67.zip
Add test for path expressions (see #56)
-rw-r--r--testing/tests/simple.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index d2111f0..fd30499 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -166,3 +166,21 @@ fn test_composition() {
let t = CompositionTemplate { foo: IfTemplate { cond: true } };
assert_eq!(t.render().unwrap(), "composed: true");
}
+
+
+#[derive(PartialEq, Eq)]
+enum Alphabet {
+ Alpha,
+}
+
+#[derive(Template)]
+#[template(source = "{% if x == Alphabet::Alpha %}true{% endif %}", ext = "txt")]
+struct PathCompareTemplate {
+ x: Alphabet,
+}
+
+#[test]
+fn test_path_compare() {
+ let t = PathCompareTemplate { x: Alphabet::Alpha };
+ assert_eq!(t.render().unwrap(), "true");
+}