I am trying to understand why there is such a thing as a .t file, as opposed to just using the .pl files. Are the .t files really the same as the .pl files but with embedded tests?

When I "use" Test::Simple, Test::More, etc., in a .pl file and run it with Perl it produces test results. Likewise, running that same .pl file with prove will produce test results although the output appears different. What's the advantage of using prove? Why not simply use Perl?

Are tests embedded into production modules? If not, how does one test (verify) that the act of physically removing tests from production code didn't accidentally interject some errors?

I understand that the use of t/ directories to contain .t files is a convention for normal module installation. My problem is that I am coming from the Win32 environment using the ActiveState installation and I therefore rely on ppm for my installs. I don't get to do the "make test" part of the installation so perhaps I just don't have a full appreciation of what testing does. But I do want to have that understanding as I am working on some code I would like to distribute. I am sure development will go better if I can embed testing in it.

Thanks for any answers.


In reply to Testing - General Questions by TomKane

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.