I'm getting into testing a lot more lately and I realize that Test::More
doesn't do what I would like it to do and thus I'm creating my own test
class.
If your new module uses Test::Builder, you can use it and Test::More together and save yourself a lot of hassle. Just create a new Test::Builder object in your class (it'll be the same one that Test::More uses), export your functions, and write to Test::Builder.
That means you don't have to deal with the plan or the ok() or anything else you get from Test::More.
#I believe this tells us the version of the perl module that I'm writing.
$VERSION = '0.01';
Yes.
#I think this tells what we can export
@EXPORT = qw(ok
is isnt like unlike
skip todo todo_skip
pass fail
$TODO
plan
diag
);
Yes.
#I have no idea what this does
sub _export_to_level
{ ... }
It puts the Test::More functions in the right place; it's basically code from Exporter that isn't present in the oldest versions.
#I think this gets called when use MY::Module; is seen.
sub import {
my($class) = shift;
goto &plan;
}
Yes.
-- c