[stringtemplate-interest] Unit test framework for StringTemplate
Terence Parr
parrt at cs.usfca.edu
Sun Apr 22 18:06:52 PDT 2007
I have been thinking for quite a while about adding *, +, and ? to
the definition of template arguments so that you know whether you
should get zero more, one or more, or zero or one values in the
attribute. That way ST can check the cardinality and existence
automatically for you.
Ter
On Feb 8, 2007, at 11:00 PM, Jose San Leandro wrote:
> Hi,
>
> I'm making heavy use of StringTemplate in several projects, using a
> non-TDD
> developing methodology: change template, check template filling
> logic, build
> project, execute project, check template output.
>
> It should be much better if I could, from a template
> 1) Generate a "TemplateFiller" interface, with all the getters that
> the
> template is expecting.
> 2) Generate a junit test that uses a "<TemplateFiller>UnitTestImpl"
> instance
> (which is the test itself) and compares the output of the template
> with the
> contents of a provided file.
>
> Basically, I need a StringTemplate parser. I guess StringTemplate
> itself
> defines an ANTLR-based one I could use.
>
> Do you think it would be possible to use it to extract all input
> parameters
> from a template? It would have to be recursive itself, and probably
> indicate
> at the end that the template input is an object graph, so I guess
> it will have
> to traverse the AST for a template.
>
> I think a unit test framework for StringTemplate is highly desirable.
>
> What do you think?
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list