|
@@ -59,10 +59,14 @@ tests() ->
|
|
|
<<"{{ var1 }}">>, dict:store(var1, "bar", dict:new()), <<"bar">>},
|
|
|
{"Render variable in gb_tree",
|
|
|
<<"{{ var1 }}">>, gb_trees:insert(var1, "bar", gb_trees:empty()), <<"bar">>},
|
|
|
+ {"Render variable in arity-1 func",
|
|
|
+ <<"I enjoy {{ var1 }}">>, fun (var1) -> "Othello" end, <<"I enjoy Othello">>},
|
|
|
{"Render variable with attribute in dict",
|
|
|
<<"{{ var1.attr }}">>, [{var1, dict:store(attr, "Othello", dict:new())}], <<"Othello">>},
|
|
|
{"Render variable with attribute in gb_tree",
|
|
|
<<"{{ var1.attr }}">>, [{var1, gb_trees:insert(attr, "Othello", gb_trees:empty())}], <<"Othello">>},
|
|
|
+ {"Render variable with attribute in arity-1 func",
|
|
|
+ <<"I enjoy {{ var1.game }}">>, [{var1, fun (game) -> "Othello" end}], <<"I enjoy Othello">>},
|
|
|
{"Render variable in parameterized module",
|
|
|
<<"{{ var1.some_var }}">>, [{var1, erlydtl_example_variable_storage:new("foo")}], <<"foo">>},
|
|
|
{"Nested attributes",
|