diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-04-27 13:47:35 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-04-27 13:47:35 +0200 |
commit | 730a2ea666943ef2facc97e0e135a325cc5e7a95 (patch) | |
tree | 394b5a5c95ad63f03a44e5232d566b1f39301fbf /testing/tests/simple.rs | |
parent | cbea9814d28763035195a87bc3fcfb54c64ebe7b (diff) | |
download | askama-730a2ea666943ef2facc97e0e135a325cc5e7a95.tar.gz askama-730a2ea666943ef2facc97e0e135a325cc5e7a95.tar.bz2 askama-730a2ea666943ef2facc97e0e135a325cc5e7a95.zip |
Add test for unary - operator
Diffstat (limited to '')
-rw-r--r-- | testing/tests/simple.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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"); +} |