The stupid question is the question not asked | |
PerlMonks |
•Re: Testing Template, or should I write a diff for TT templates?by merlyn (Sage) |
on Nov 14, 2003 at 18:11 UTC ( [id://307137]=note: print w/replies, xml ) | Need Help?? |
The fact that it uses a templating engine is merely a distraction. What you actually have is a system that outputs certain text.
Consider it a black box. For some given set of inputs, it should produce an acceptable output text. What defines that acceptability? That's what you test. If you use a regex-based engine or a literal match, that's up to you. If someone checks in a template that fails that test, then you either fix the template or fix the test. For example, you could have as one of your acceptance standards that it forms valid XML. So part of your test, you parse the XML. If it fails, that's not acceptable. -- Randal L. Schwartz, Perl hacker
In Section
Seekers of Perl Wisdom
|
|