Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: •Re: Testing Template, or should I write a diff for TT templates?

by EvdB (Deacon)
on Nov 14, 2003 at 18:21 UTC ( [id://307140]=note: print w/replies, xml ) Need Help??


in reply to •Re: Testing Template, or should I write a diff for TT templates?
in thread Testing Template, or should I write a diff for TT templates?

Do you mean something like this:
Template: blah blah [% user.name %] blah, blah. Test data: $$vars{user}{name} = "<<<<<< user.name >>>>>>" Template produces: blah blah <<<<<< user.name >>>>>> blah, blah. Testing code: ok( $output =~ m/<<<<<< user.name >>>>>>/ );
However this method could easily lead to very involved tests for complicated pages - and testing the test code could become trickier than testing the template.

Also if I have understood you correctly it will make it difficult to test real world data. As I see it the only really good way to test the templates is to create simplified ones and then to check the output against known good results - even if that is more labour intensive.

--tidiness is the memory loss of environmental mnemonics

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://307140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-03-28 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found