From 4bd89aa6936b343d53968fb1d4d1960140b13b67 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 4 Oct 2017 21:09:02 +0200 Subject: Add test for path expressions (see #56) --- testing/tests/simple.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'testing/tests') 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"); +} -- cgit