diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-04-27 13:44:31 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-04-27 13:44:31 +0200 |
commit | cbea9814d28763035195a87bc3fcfb54c64ebe7b (patch) | |
tree | 718fc9150df659e5eaa6760c7bfd4db189cca6d7 /testing/tests | |
parent | 08dbe0a466cdfb3a35e19911ee364e6a0ed0f1d3 (diff) | |
download | askama-cbea9814d28763035195a87bc3fcfb54c64ebe7b.tar.gz askama-cbea9814d28763035195a87bc3fcfb54c64ebe7b.tar.bz2 askama-cbea9814d28763035195a87bc3fcfb54c64ebe7b.zip |
Add test for ! operator (see #83)
Diffstat (limited to 'testing/tests')
-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 c9c3c0c..f532eaa 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -207,3 +207,16 @@ fn test_comment() { let t = CommentTemplate {}; assert_eq!(t.render().unwrap(), " "); } + + +#[derive(Template)] +#[template(source = "{% if !foo %}Hello{% endif %}", ext = "txt")] +struct NegationTemplate { + foo: bool, +} + +#[test] +fn test_negation() { + let t = NegationTemplate { foo: false }; + assert_eq!(t.render().unwrap(), "Hello"); +} |