|
@@ -1085,6 +1085,10 @@ tests() ->
|
|
|
<<"{% with a=1 %}{{ a }}{% endwith %}">>, [], <<"1">>},
|
|
|
{"Cache variable",
|
|
|
<<"{% with a=b %}{{ a }}{% endwith %}">>, [{b, "foo"}], <<"foo">>},
|
|
|
+ {"Cache variable with attribute",
|
|
|
+ <<"I enjoy {% with a = var1 %}{{ a.game }}{% endwith %}">>, [{var1, [{game, "Othello"}]}], <<"I enjoy Othello">>},
|
|
|
+ {"Cache variable attribute",
|
|
|
+ <<"I enjoy {% with a = var1.game %}{{ a }}{% endwith %}">>, [{var1, [{game, "Othello"}]}], <<"I enjoy Othello">>},
|
|
|
{"Cache multiple",
|
|
|
<<"{% with alpha=1 beta=b %}{{ alpha }}/{{ beta }}{% endwith %}">>, [{b, 2}], <<"1/2">>}
|
|
|
]},
|