Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Jan 28, 2025
1 parent 2b7d4e3 commit eae86bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions minijinja/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ impl UndefinedBehavior {
(UndefinedBehavior::Strict, &ValueRepr::Undefined | &ValueRepr::SilentUndefined) => {
Err(Error::from(ErrorKind::UndefinedError))
}
(UndefinedBehavior::MostlyStrict, &ValueRepr::Undefined) => {
Err(Error::from(ErrorKind::UndefinedError))
}
_ => Ok(value.is_true()),
}
}
Expand Down
7 changes: 3 additions & 4 deletions minijinja/tests/test_undefined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ fn test_mostly_strict_undefined() {
);
assert_eq!(
env.render_str(
"{% if x.foo %}...{% endif %}",
"<{% if x.foo %}...{% endif %}>",
context! { x => HashMap::<String, String>::new() }
)
.unwrap_err()
.kind(),
ErrorKind::UndefinedError
.unwrap(),
"<>"
);
assert_eq!(
env.render_str("{{ undefined|list }}", ())
Expand Down

0 comments on commit eae86bc

Please sign in to comment.