Testes, testes, one, two... three?

TorgoX on 2002-02-19T16:57:09

Gisle Aas is a superstar. He always surprises me with his good ideas, which are almost always cleverly simple.

If you do single module hacks then it is popular to integrate its tests in the module with something like:

package Foo;

# ...

unless (caller) {
    # test me
    ...
}

1;

Makes more sense to me to extract a test script from this kind of setup instead of from a POD section. During development you test by 'perl Foo.pm' and when you are happy and want to upload it you 'makepmdist' it.

I'm not sure how to integrate this with the whole t/test.t system tho. I don't see how to have test code that would actually be able to say "use Foo;". So , for example, you couldn't really test that Foo was exporting what its docs say it will export.

Ideas, anyone?