Browse Source

Add unit test for missing dict lookup. (#4)

Andreas Stenius 11 years ago
parent
commit
2dd42a2831
1 changed files with 2 additions and 0 deletions
  1. 2 0
      tests/src/erlydtl_unittests.erl

+ 2 - 0
tests/src/erlydtl_unittests.erl

@@ -67,6 +67,8 @@ tests() ->
                     <<"I also enjoy {{ var1.game }}">>, [{var1, [{<<"game">>, "Parcheesi"}]}], <<"I also enjoy Parcheesi">>},
 		   {"Render variable in dict",
                     <<"{{ var1 }}">>, dict:store(var1, "bar", dict:new()), <<"bar">>},
+           {"Render variable with missing attribute in dict",
+                    <<"{{ var1.foo }}">>, [{var1, dict:store(bar, "Othello", dict:new())}], <<"">>},
 		   {"Render variable in gb_tree",
                     <<"{{ var1 }}">>, gb_trees:insert(var1, "bar", gb_trees:empty()), <<"bar">>},
 		   {"Render variable in arity-1 func",