Greatly expand the explicit_context_setting test.
Turns out explicit context setting works in a lot more places than the official dustjs pages indicate. Also some things don't make much sense (like setting it on a block works but not on an inline partial).
This commit is contained in:
@@ -341,15 +341,17 @@ where
|
||||
F: Fn(Container<'a>) -> DustTag<'a>,
|
||||
{
|
||||
move |i: &'a str| {
|
||||
let (i, (opening_name, inner, maybe_else, _closing_name)) = verify(
|
||||
tuple((
|
||||
delimited(tag(open_matcher), path, tag("}")),
|
||||
opt(body),
|
||||
opt(preceded(tag("{:else}"), opt(body))),
|
||||
delimited(tag("{/"), path, tag("}")),
|
||||
)),
|
||||
|(open, _inn, _maybe_else, close)| open == close,
|
||||
)(i)?;
|
||||
let (i, (opening_name, maybe_explicit_context, inner, maybe_else, _closing_name)) =
|
||||
verify(
|
||||
tuple((
|
||||
preceded(tag(open_matcher), path),
|
||||
terminated(opt(preceded(tag(":"), path)), tag("}")),
|
||||
opt(body),
|
||||
opt(preceded(tag("{:else}"), opt(body))),
|
||||
delimited(tag("{/"), path, tag("}")),
|
||||
)),
|
||||
|(open, _maybe_explicit, _inn, _maybe_else, close)| open == close,
|
||||
)(i)?;
|
||||
|
||||
Ok((
|
||||
i,
|
||||
|
||||
Reference in New Issue
Block a user