google / escapevelocity

A subset reimplementation of Apache Velocity with a much simpler API.
Apache License 2.0
33 stars 11 forks source link

Added a Unit Test to increase code coverage #27

Open TheRealHaui opened 1 year ago

TheRealHaui commented 1 year ago

Added a Unit Test to increase code coverage

eamonnmcmanus commented 1 year ago

Thanks!

I'm all for increasing code coverage, but I wonder if the same effect might be achieved more simply by adding a new test method to TemplateTest. I think the idea here is that the in parameter to ForEachNode isn't iterable, which should get an exception. Could we test evaluating a template like this?

#foreach ($i in 2853)
#if (2853) 2853 #else 2853 #end
#end

I think that's equivalent?