On Fri, Jul 28, 2000 at 05:07:24PM -0400, Barrie Slaymaker wrote:
>
> I think the =also tag approach does that pretty well, but I'm not
> hearing anyone else say yay/nay on it.
>
> Whether the examples get converted to tests could be flagged in
> POD at the top of the file, or by using slightly different syntaxs:
>
> =also_for lint
>
> =also_for test foo.t
>
> instead of
>
> =also_for example
>
> So, is it crazy? Too complex? Or just BOOOOOoooooring?
I think we're all just cogitating.
How about this? All code snippets are verbatim paragraphs, right? So why
don't we just add "=for testing" (or whatever) blocks just before each
of them. The program(s) that test the code would know that all verbatim
paragraphs immediately after "=for testing" blocks are to be part of a
single test case and do something appropriate.
-----begin example-----
=for testing
# Do nothing, no initialization necessary
=end testing
print 1 + 1; # should print 2
The above code should print the number 2!
=for testing
use LWP::Simple
=end testing
$page = get("http://www.perl.org");
-----end example-----
We could probably also put things like
=head1 NAME Test LWP::Simple
in between the "=for testing" and "=end testing". (Give tests names as
well as numbers)
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]