Sorry I can't offer you a tutorial, but take a look at the tests that come with OpenGuides and the CGI::Wiki family of modules. You should be able to find examples of the kind of scenarios your wiki formatter needs to cope with, especially as we were doing very much the same job.
This highlights an interesting design point, in that if you separate the text munging from the web stuff, you can write tests that don't rely on having Apache running, let alone configured.
Basically, I don't want to test for things I know. I want to test for all the possible arbitrary text that users could throw, and see if my module can format it to valid html in the manner that the users expected it to do.
That's a toughy. You DO want to write tests for things you know - this is a starting point. In terms of all possible text, this is fairly intractible. Consider the documentation. The pod that goes with the module gives examples of how to use it - these examples should be included in the tests. For the more esoteric scenarios, my advice would be to get a project team or an on-line community together, inviting feedback from as many tech-savvy users as possible.
Every time you find something that misbehaves, write a test for it.
Good luck with your module
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||