-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for variable resolution coverage
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
core/src/test/resources/com/squarespace/template/plugins/f-macro-12.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
:JSON | ||
{ | ||
"one": { | ||
"two": { | ||
"key": "hello" | ||
} | ||
}, | ||
"@": { | ||
"@": "X" | ||
} | ||
} | ||
|
||
:PARTIALS | ||
{ | ||
"m2": "{.if @}pass2{.or}fail2{.end} {@|json}" | ||
} | ||
|
||
:TEMPLATE | ||
{.macro m1}{.if @}pass1{.or}fail1{.end} {@|apply m2}{.end} | ||
|
||
{@|apply m1} | ||
{@.one|apply m1} | ||
{@.one.two|apply m1} | ||
|
||
{@.one.two.three|apply m1} | ||
{@.two|apply m1} | ||
{missing|apply m1} | ||
|
||
:OUTPUT | ||
pass1 pass2 {"one":{"two":{"key":"hello"}},"@":{"@":"X"}} | ||
pass1 pass2 {"two":{"key":"hello"}} | ||
pass1 pass2 {"key":"hello"} | ||
|
||
fail1 fail2 | ||
fail1 fail2 | ||
fail1 fail2 |