Thank you for explaining the thoughts behind $trap.
Cheers, Nadim.
Jonathan Rockway <[EMAIL PROTECTED]> writes:
> I think the most sane interface would be:
>
> my $trap = trap { ... };
> is $trap->foo, 'foo';
> is $trap->bar, 'bar';
Test::Trap already provides:
trap { ... };
is $trap->foo, 'foo'; # for certain values of foo
is $trap->bar, 'bar'; # ... a
* Jonathan Rockway <[EMAIL PROTECTED]> [2008-05-03 21:15]:
> You said you're trying to emulate $@, but $@ can be changed out
> from under you rather easily, so instead of:
>
> eval { foo() };
> if($@){ error }
>
> The defensive programmer will write:
>
> my $result = eval { foo() };
> if
* On Fri, May 02 2008, Eirik Berg Hanssen wrote:
> nadim khemir <[EMAIL PROTECTED]> writes:
>
>> On Friday 02 May 2008 01.24.00 Eirik Berg Hanssen wrote:
>>> use Test::More tests => 1;
>>> use Test::Trap;
>>> trap { warn "1\n2\n3" };
>>> $trap->warn_like(0, qr/1\n2\n3/);
>>
>> Ah! I like this. How
nadim khemir <[EMAIL PROTECTED]> writes:
> On Friday 02 May 2008 01.24.00 Eirik Berg Hanssen wrote:
>> use Test::More tests => 1;
>> use Test::Trap;
>> trap { warn "1\n2\n3" };
>> $trap->warn_like(0, qr/1\n2\n3/);
>
> Ah! I like this. How did I miss this module??
Perhaps I just haven't been _qu
On Friday 02 May 2008 01.24.00 Eirik Berg Hanssen wrote:
> use Test::More tests => 1;
> use Test::Trap;
> trap { warn "1\n2\n3" };
> $trap->warn_like(0, qr/1\n2\n3/);
Ah! I like this. How did I miss this module??
is it possible to have trap{} return an object/sub/whatever that is created by
the
nadim khemir <[EMAIL PROTECTED]> writes:
> Thanks to your help (and trying to reproduce the error in simpler code) I
> have
> found an error in my testing and in the silly I used to fix it.
Ah. Cool. :)
> Note that:
>
> warning_like
> {
> warn "1\n2\n3" ;
> } qr/1\n2\n3/ ;
>
> still doesn
On Thursday 01 May 2008 20.06.52 Eirik Berg Hanssen wrote:
> What precisely must "something()" be? I tried the following:
> So. Where do I look?
Here is the (simplified) code that would generate the warning I thought was a
problem (read below)
my ($search_regex, $replacement_regex) = (qr/
* nadim khemir <[EMAIL PROTECTED]> [2008-05-01 18:25]:
> On Tuesday 29 April 2008 19.52.08 Aristotle Pagaltzis wrote:
> > If the warning is normal, how about disabling it? If a warning
> > does not signify a problem, there is absolutely no point in
> > having perl emit one anyway.
>
> It's a perl
nadim khemir <[EMAIL PROTECTED]> writes:
> warning_like
> {
> something() ;
> } qr'Use of uninitialized value in substitution iterator' ;
>
>
> I get the warning on the terminal which is boring when one works with a
> module
> but worse when zealots (that would be Gabor) report
On Tuesday 29 April 2008 19.52.08 Aristotle Pagaltzis wrote:
> If the warning is normal, how about disabling it? If a warning
> does not signify a problem, there is absolutely no point in
> having perl emit one anyway.
It's a perl warning (in an eval) not something I output.
Cheers, Nadim.
* nadim khemir <[EMAIL PROTECTED]> [2008-04-27 14:00]:
> Since I didn't remember that the warnings were normal, I had to
> dig a bit to find that out.
If the warning is normal, how about disabling it? If a warning
does not signify a problem, there is absolutely no point in
having perl emit one any
On Tuesday 29 April 2008 03.24.48 Michael G Schwern wrote:
> > BTW: Test::Warn suck a bit because it doesn't check the warning you emit
> > but the _first_ line of the warning you emit (hmm, time for a patch
> > maybe).
>
> All the warnings_* functions take an array ref of warnings.
You can't test
nadim khemir wrote:
I have had a problems with output when running tests, this happends, IE, when
perl output a warning.
warning_like
{
something() ;
} qr'Use of uninitialized value in substitution iterator' ;
I get the warning on the terminal which is boring when one
Hi,
I have had a problems with output when running tests, this happends, IE, when
perl output a warning.
warning_like
{
something() ;
} qr'Use of uninitialized value in substitution iterator' ;
I get the warning on the terminal which is boring when one works with a mod
15 matches
Mail list logo