wolfendale / scala-nunjucks

5 stars 1 forks source link

Fix imports and macros #42

Closed wolfendale closed 4 years ago

wolfendale commented 4 years ago

This fixes all of the equivalence tests that were failing related to macros and template imports (other than a few that also rely on template inheritance)

Added more tests for imports and macros

I really didn't like having to add the RenderMode to allow macros to have different behaviour depending on whether they've been imported or not. I'm also pretty unhappy with the code for macros in general. Dealing with them as a purely functional computation has battered my noggin somewhat. I'd definitely love a simpler approach if anyone can think of one.

This also fixes an issue with resource loading that was causing a resource loader test to fail. I've added a simplified version of the failing case to the macro specs. As a side effect the play test project works again!