From 1a58b357436ed70a886fda0d45e3f62e52cc8247 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 11 Sep 2024 19:56:04 +0200 Subject: [PATCH] Add more tests for `!` operator --- rinja_derive/src/tests.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rinja_derive/src/tests.rs b/rinja_derive/src/tests.rs index 2ef24157a..57e36ec44 100644 --- a/rinja_derive/src/tests.rs +++ b/rinja_derive/src/tests.rs @@ -407,6 +407,22 @@ match ( "{% if y is defined && !(y) %}bla{% endif %}", r#"if *(&(!(self.y)) as &::core::primitive::bool) { writer.write_str("bla")?; +}"#, + &[("y", "bool")], + 3, + ); + compare( + "{% if y is not defined || !y %}bla{% endif %}", + r#"if *(&(!self.y) as &::core::primitive::bool) { + writer.write_str("bla")?; +}"#, + &[("y", "bool")], + 3, + ); + compare( + "{% if y is not defined || !(y) %}bla{% endif %}", + r#"if *(&(!(self.y)) as &::core::primitive::bool) { + writer.write_str("bla")?; }"#, &[("y", "bool")], 3,