Skip to content

Commit

Permalink
Merge pull request #172 from GuillaumeGomez/fix-invalid-cond-opt
Browse files Browse the repository at this point in the history
Add more tests for `!` operator
  • Loading branch information
Kijewski authored Sep 11, 2024
2 parents 548036f + 1a58b35 commit be7cc39
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions rinja_derive/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit be7cc39

Please sign in to comment.