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
Michael G Schwern wrote at Sun, 07 Jul 2002 04:06:02 +0200:
> You have to be extra careful about preserving the call stack, since the BLOCK is
>called inside
> warns_ok() as a subroutine. Consider:
>
> # line 5 "foo.pl"
> warns_ok { warn "Foo" } /^Foo in foo.pl at line 5$/;
>
Hello!
I released now Test::Warn 0.05 in CPAN and I decided me to give this interface:
use Test::Warn;
warning_is{foo(-dri => "/")} "Unknown Parameter 'dri'", "dri != dir gives
warning";
warnings_are {bar(1,1)} ["Width very small", "Height very small"];
warning_is{add(2,2)} undef
Chromatic wrote at Sat, 27 Jul 2002 18:55:38 +0200:
> On Fri, 26 Jul 2002 13:19:51 -0700, Johan Vromans wrote:
>
>> One of the problems I have with using Test::Builder is that I want to distribute
>packages to
>> systems that do not (necessarily) have a decent version of Test::* installed. Now
Hello!
I'm writing in nearly every Perl test script a method
all_ok, all_dies_ok or all_throws_ok new.
That's why I want to write a module specialled in
testing one feature for many parameters.
As I'm very interested in your opinion about,
I'll describe some planned features in the following.
Ilya Martynov wrote at Fri, 02 Aug 2002 07:42:44 +0200:
>>>>>> On Wed, 31 Jul 2002 21:52:17 +0200, Janek Schleicher <[EMAIL PROTECTED]> said:
>
> JS> [..snip..]
>
> JS> Thinking in general,
> JS> there could be also some other features included.
Nicholas Clark wrote at Fri, 02 Aug 2002 11:06:47 +0200:
>> srand could be our friend.
>
> Which is how I'm doing it at work now.
> I call srand with a random number. (I'm getting mine from /dev/urandom,
> but I suspect that calling rand() and using that to prime srand will
> achieve sufficient
Tels wrote at Sat, 03 Aug 2002 00:25:54 +0200:
> te@null:~> perl -e 'print rand(),"\n"'
> 0.159625336368666
> te@null:~> perl -e 'print rand(),"\n"'
> 0.292230773325176
> te@null:~> perl -e 'print rand(),"\n"'
> 0.708889858870865
> te@null:~>
>
> This means perl does something like srand(rand())
Nicholas Clark wrote at Sat, 10 Aug 2002 01:53:29 +0200:
>> I think the most fair way to handle it,
>> is to give a warning when Test::ManyParams is used twice with seeding setting
>> in the same package.
>
> Yes. This sounds like what I'm doing at work - if two attempts to call the
> seeding fu
Adrian Howard wrote at Fri, 28 Feb 2003 11:40:52 +:
> I'd argue that Test::Warn isn't the right place :-) To me sending
> output to STDERR and warnings are different things.
Absolutely.
> If added to Test::Warn I'd argue for separate functions. I've had
> situations where warnings were log
10 matches
Mail list logo