Michael G Schwern wrote:
> 
> In One Sentence
> ---------------
> 
> Regression tests should be embedded in the code and documentation near what
> it is they're testing.

s/embedded/embeddable/ and I'm there.  I don't think you can necessarily
embed tests right near the code you want to test, and some tests
don't necessarily belong to a particular module or piece of code.  So
we need to keep the current testing scheme, at least, and allow test-happy
coders to embed tests if they like.

Some thoughts:

This isn't POD, and it would confuse all the POD parsers out there.  How
about extending Test::Harness to scan for /^sub TEST_\d+/ and running them
in order?  A 

$TEST_PREFIX = 'Foo_Test_' ;

line could be scanned for like MakeMaker scans for $VERSION if people
need/want to change the re to /^$TEST_PREFIX\d+/.  If numbered tests
aren't cool, then use named tests run in as-defined order.

Don't bother trimming them out of the source on installation, they can
help enlighten people reading the nearby source, and less modification
of the source files would be less confusing in general.  Teach POD::Parser
to ignore it.  That'll also encourage people to migrate towards POD::Parser.

The ok(), skip(), print, whatever should be part of the TEST_... sub,
so people can implement more sophisticated stuff.

The numbers in the test sub names would be allowed to have gaps, in
which case the skipped numbers would be emitted as todo's.

- Barrie

Reply via email to