RFC: Test::Warn

2002-06-27 Thread Janek Schleicher

Hi!

Sometimes I want to test,
whether a module gives a (special) warning or not.

I couldn't find a module doing this job on CPAN,
so I'm ready to write a Test::Warn module.

I thought that two methods should be implemented:
warns_ok BLOCK  REGEX, TEST_NAME   (regex and test_name are optional)
no_warns_ok  BLOCK  TEST_NAME  (test_name is optional)

(similar to throws_ok and lives_ok from Test::Exception)


I'd like to know what you are thinking about ?, especially:
 - is it already on CPAN
 - Name: Test::Warn / Test::Warning / Test::Warnings / ...
 - method names
 - missing functionality


Thanks in advance,
Janek



Re: RFC: Test::Warn

2002-06-27 Thread chromatic

On Thu, 27 Jun 2002 07:32:31 -0700, Janek Schleicher wrote:

> I couldn't find a module doing this job on CPAN, so I'm ready to write a
> Test::Warn module.

This is something I'd use.

> I'd like to know what you are thinking about ?, especially:
>  - is it already on CPAN
>  - Name: Test::Warn / Test::Warning / Test::Warnings / ...
>  - method names
>  - missing functionality

no_warns_ok() seems awkward, but my best alternative is warns_nok(), which
isn't any better.

It might be nice if you could check for Carp methods, too.  I've found myself
doing that several times.

-- c