From 730a2ea666943ef2facc97e0e135a325cc5e7a95 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 27 Apr 2018 13:47:35 +0200 Subject: Add test for unary - operator --- testing/tests/simple.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testing') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index f532eaa..afd82e9 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -220,3 +220,16 @@ fn test_negation() { let t = NegationTemplate { foo: false }; assert_eq!(t.render().unwrap(), "Hello"); } + + +#[derive(Template)] +#[template(source = "{% if foo > -2 %}Hello{% endif %}", ext = "txt")] +struct MinusTemplate { + foo: i8, +} + +#[test] +fn test_minus() { + let t = MinusTemplate { foo: 1 }; + assert_eq!(t.render().unwrap(), "Hello"); +} -- cgit