[stringtemplate-interest] stringtemplate-interest Digest, Vol 77, Issue 4
Rafael Chaves
rafael at alphasimple.com
Mon Aug 1 13:11:33 PDT 2011
Thanks, Ted, but I was aiming for something accessible to template
authors (without having to resort to writing code).
Cheers,
Rafael
> Date: Mon, 1 Aug 2011 12:32:52 -0700
> From: Terence Parr <parrt at cs.usfca.edu>
> Subject: Re: [stringtemplate-interest] template testing
> To: stringtemplate-interest Template
> <stringtemplate-interest at antlr.org>
> Message-ID: <92140596-25DE-46B1-B4D7-F28A2D8578D8 at cs.usfca.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hi.I do this all the time... drumroll please... using array of strings ;)
>
> String[] pairs = {
> "input", "output",
> "input2", "output2",
> ...
> };
>
> then I loop around it :)
>
> Ter
>
> On Aug 1, 2011, at 12:14 PM, Rafael Chaves wrote:
>
>> We adopted StringTemplate in a MDD tool we are developing where users
>> can customize code generation by editing their templates. I really
>> miss an easy way to test the templates. Is there anything out there
>> for this? (If not, we will be rolling our own)
>>
>> Basically, what I am thinking of is to conventionally use two
>> templates to represent a test case: one defines the expected output,
>> and another defines the actual output (by applying the template to be
>> tested to some parameters). The test runner basically renders each
>> pair of templates and compares the outputs - if they match, it is a
>> pass, if they don't, it is a failure (maybe if only spaces differ,
>> make it a warning).
>>
>> Has anyone seen anything like that?
>>
>> Cheers,
>>
>> Rafael
>> http://alphasimple.com
More information about the stringtemplate-interest
mailing list