On 20/07/06, Ovid <[EMAIL PROTECTED]> wrote:
----- Original Message ----
From: Gabor Szabo <[EMAIL PROTECTED]>

> I admit, I did not even know that it existed until recently.
> I guess I have not read the full documentation of Test::More and Test::Builder
> but I assume there are not many that do.
>
> [regarding documentation of $Test::Builder::Level]

Up until I had written Test::JSON, I had never heard of it (or if I did, I 
didn't remember) and I've been writing tests for years.  The fact that this is 
such a core concept for getting reporting correct and yet so many hard-core 
testers don't know about it suggests that it should be mentioned far more 
prominently.

> > Should it be in Test::More?  Perhaps it should be in Test::Tutorial.  I 
don't
> > know.  I welcome suggestions.

I think it should be mentioned in both.  Yes, that's more work to synchronize 
this information but even Test::Builder doesn't highlight how important this is 
(http://search.cpan.org/dist/Test-Simple/lib/Test/Builder.pm#Test_style).

Now that I stop to think about it, what would be good is a new document added 
to the distribution named something like 'Test::GuideLines' or 
'Test::BestPractices' or something similar.  Once someone gets to the point of 
being comfortable with simple test scripts, they start to wonder if they're 
writing *good* test scripts.  Many tests, mine included, are just long 
procedural lists of assertions.  Organizing tests, suggestions for setting up 
test databases, etc., would be very useful.  And that, not uncoincidentally, 
would be a perfect place to highlight the importantance of $Level.

But for now, Test::More and Test::Tutorial are the best places since those have 
the docs that people read the most.

The only time it does anything useful is when you have a subroutine
which runs exactly 1 test. If you add another test then no amount of
twiddling $T::B::L will get you the info you need.

Test::XXX module authors need to know it, I think test script authors
should remain blissfully unaware. There's very little to be gained and
much confusion as people try to figure out how to make it work in
situations where it cannot work,

F

Reply via email to