Re: Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Michael Carman
On 7/9/2004 4:57 PM, Paul Johnson wrote: > On Fri, Jul 09, 2004 at 12:10:52PM -0500, Pete Krawczyk wrote: > >> Consider [code with unreachable path] Devel::Cover will always see that as >> a partial test, and never a full test: Is that a bug, then? That's for you to decide. The lack of coverage s

Re: Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Paul Johnson
On Fri, Jul 09, 2004 at 12:10:52PM -0500, Pete Krawczyk wrote: > Consider the following code: > > $impclass ||= implementor($scheme) || > do { > require URI::_foreign; > $impclass = 'URI::_foreign'; > }; > > That's in URI.pm, lines 54-58. > > Devel::C

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-09 Thread Michael G Schwern
On Fri, Jul 09, 2004 at 06:31:09PM -0400, Michael G Schwern wrote: > Looking through a coverage analysis I just ran, here's some more idioms > that trip up 100% coverage. > > my $foo = $bar || ''; > > my $foo = $bar || 1; > > $this || return; > > Basically anything of the "$f

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-09 Thread Michael G Schwern
On Fri, Jul 09, 2004 at 05:06:09PM -0500, Andy Lester wrote: > > There's a whole set of these sort of problems. Looking through a coverage analysis I just ran, here's some more idioms that trip up 100% coverage. my $foo = $bar || ''; my $foo = $bar || 1; $this || retu

Re: Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Ricardo SIGNES
* Pete Krawczyk <[EMAIL PROTECTED]> [2004-07-09T13:10:52] > > Devel::Cover will always see that as a partial test, and never a full > test: > [ ... ] > Is that a bug, then? Or is it something else? And how should I notate > that, keeping in mind the goals of Phalanx, so that it's clearly visibl

Re: Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Michael G Schwern
On Fri, Jul 09, 2004 at 12:10:52PM -0500, Pete Krawczyk wrote: > Consider the following code: > > $impclass ||= implementor($scheme) || > do { > require URI::_foreign; > $impclass = 'URI::_foreign'; > }; > > That's in URI.pm, lines 54-58. > > Devel::Co

Re: Phalanx: What if full coverage isn't possible? (fwd)

2004-07-09 Thread Andy Lester
> There's a whole set of these sort of problems. > > sub new { > my $proto = shift; > my $class = ref $proto || $proto; In this case, we probably don't want that ANYWAY. That's what I did when I was through Data::Page for Leon Brocard, and it's now at 100% coverage, across the

Re: [IDEA] Drop into the debugger on failure

2004-07-09 Thread Andrew Pimlott
On Fri, Jul 09, 2004 at 11:00:28AM -0400, Michael G Schwern wrote: > wrap *Test::Builder::diag, pre => sub { > $_[1] = color('red') . $_[1]; > $_[-2] =~ s/$/color 'reset'/e; > }; Glancing at the Hook::LexWrap, I see it's possible to simulate an "around" wrapper by calling the original f

Phalanx: What if full coverage isn't possible?

2004-07-09 Thread Pete Krawczyk
Consider the following code: $impclass ||= implementor($scheme) || do { require URI::_foreign; $impclass = 'URI::_foreign'; }; That's in URI.pm, lines 54-58. Devel::Cover treats that as a conditional. So short of deleting URI::_foreign, that do BLOCK

Re: [IDEA] Drop into the debugger on failure

2004-07-09 Thread Fergal Daly
On Fri, Jul 09, 2004 at 11:00:28AM -0400, Michael G Schwern wrote: > Never underestimate The Damian. For a moment I though I had. > #!/usr/bin/perl -w > > use Hook::LexWrap; > use Test::Builder; > use Term::ANSIColor; > > wrap *Test::Builder::diag, pre => sub { > $_[1] = color('red') . $_

Re: [IDEA] Drop into the debugger on failure

2004-07-09 Thread Michael G Schwern
On Fri, Jul 09, 2004 at 10:40:54AM +0100, Fergal Daly wrote: > Is there a LexWrap equivalent of > > use Test::Builder::Vapour::Override; > > sub diag { > my ($self, $diag) = @_; > $self->SUPER::diag(colour_me($diag)); > } > > ? It seems that LexWrap wrappers can't do this as they can't chang

Re: [IDEA] Drop into the debugger on failure

2004-07-09 Thread Fergal Daly
On Thu, Jul 08, 2004 at 08:40:54PM -0400, Michael G Schwern wrote: > On Thu, Jul 08, 2004 at 11:53:52PM +0100, Fergal Daly wrote: > > The main point was that the OO way works right now, > > So does event hooks. Hooks are things you can hang stuff off of, but > they're also used to snare things th