Skip to content

Commit

Permalink
Add unit tests for {% elif Expr %} syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn-Egil Dahlberg authored and psyeugenic committed Jul 20, 2012
1 parent 914781a commit 748dc8b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/src/erlydtl_unittests.erl
Expand Up @@ -87,6 +87,13 @@ tests() ->
{"if", [
{"If/else",
<<"{% if var1 %}boo{% else %}yay{% endif %}">>, [{var1, ""}], <<"yay">>},
{"If elif",
<<"{% if var1 %}boo{% elif var2 %}yay{% endif %}">>, [{var1, ""}, {var2, "happy"}], <<"yay">>},
{"If elif/else",
<<"{% if var1 %}boo{% elif var2 %}sad{% else %}yay{% endif %}">>, [{var1, ""}, {var2, ""}], <<"yay">>},
{"If elif/elif/else",
<<"{% if var1 %}boo{% elif var2 %}yay{% elif var3 %}sad{% else %}noo{% endif %}">>, [{var1, ""},
{var2, "happy"}, {var3, "not_taken"}], <<"yay">>},
{"If",
<<"{% if var1 %}boo{% endif %}">>, [{var1, ""}], <<>>},
{"If not",
Expand Down

0 comments on commit 748dc8b

Please sign in to comment.