mojombo / mustache.erl

Mustache template engine for Erlang.
MIT License
239 stars 59 forks source link

Variable List can be bound to another list. #9

Closed andreashasse closed 11 years ago

andreashasse commented 12 years ago

The function mustache:compiler/2 generate a complex structure of fun out of the template. When you have a template like this one: {{#apis}} {{url}} {{#method}} {{stuff}} {{/method}} {{/apis}}

... and apis and methods are different lists, the method will generete a error message. This is a small demonstration of the problem:

(fun() -> List = a, (fun() -> List = b, List end)() end)().

This pull request might not be the best solution, but I hope it works.

pusewicz commented 12 years ago

@anha0825 Could you please add a test suite for this?

hukl commented 12 years ago

Are you kidding? You have a template engine with two super tiny tests which barely deserve the name. This library had a bug (booleans) for several months, compromising one major feature and you are asking the contributors to add a test suite before even considering it? Classy!

pusewicz commented 12 years ago

We have to start adding tests at some point. It's better to start it sooner than later.