On Thu, Feb 15, 2001 at 01:38:22PM -0500, barries wrote:
> What do folks think of adding something like the following to Test.pm:
<snicker-snatch>
> 
> This would make for very succinct easy to maintain test suites, if your
> test suite is simple enough:
> 
>    use Test qw( do_tests ) ;
> 
>    do_all_tests(
>       frobnitz => sub {
>        ok( 1 ) ;
>       },
>       skip => sub {
>        ok( 1 ) ;
>       },
>       todo => sub {
>          ok( 1 ) ;
>       },
>    ) ;

What does this gain you over the more flexible and easier to learn and write:

  ok(frobnitz() eq 'HGLAG', 'frobnitz ok');

  skip("I don't feel like it");

  todo("I'll do it later");


> If we wanted to embed tests in module files

See Pod::Tests and pod2test
http:[EMAIL PROTECTED]/msg00236.html
http:[EMAIL PROTECTED]/msg00158.html

Its advantage (aside from existing) is that you don't slow compilation
with lots of extra test code that Perl has to compile on every run.
And its also very, very easy to write a stand-alone POD parser to
lexically scan for the embedded tests (which is what Pod::Tests does),
as opposed to using subroutines which requires either a Perl parser or
actually loading the module (which potentially has side effects).

Reply via email to