diff options
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 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"); +} |