in reply to Test Suite for a forum?
For my module CGI::Wiki::Simple, I have two kinds of tests - one kind that tests the basic functionality of every routine, throwing different inputs at it and looking that it gets the expected outputs. The other kind are end-to-end tests that set up a fake CGI request, let the wiki run, and look at the database and/or at the output of the program, to see if happened what was expected.
This second kind of test is not easy to write as it has to be adapted every time you make a change in the output format, so I suggest that you use a different set of templates for testing - a simple line-based layout will be good for easy difference testing.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
|---|