Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 26615
Status: rejected
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: a.r.ferreira [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] has_plan('any') to report a skip_all plan
Date: Tue, 24 Apr 2007 16:59:49 -0300
To: bug-Test-Simple [...] rt.cpan.org, "Michael G Schwern" <schwern [...] pobox.com>, chromatic <chromatic [...] wgz.org>
From: "Adriano Ferreira" <a.r.ferreira [...] gmail.com>
The attached patch is meant to solve the problem of determining if any of these statements were executed under the current Test::Builder instance $builder->plan( tests => $n ); $builder->plan( 'no_plan' ); $builder->plan( skip_all => $reason ); The first two may be determined looking at the return of $builder->has_plan; But that is not the case for the skip_all plan. Actually you'll have to look at the internal attribute $builder->{Skip_All} to determine this. I started a thread at perl-qa@perl.org about this and got responses from Ovid and Adrian Howard that made me see that although skip_all looks like a plan, it is special anyway. http://www.nntp.perl.org/group/perl.qa/2007/04/msg8583.html So my proposal is to leave " $builder->has_plan " as it is, but augment its behavior if an explicit argument 'any' was given. $builder->has_plan('any') => the expected number of tests, or => 'no_plan' or => 'skip_all' I've touched the documentation as well. If this patch is not accepted, at the least the phrase "Skip_all plans are handled as if no plan was set." may be added to the has_plan description. I've also inserted another test into t/skipall.t to check " has_plan('any') " works. Best regards, Adriano Ferreira.
Subject: Re: [rt.cpan.org #26615] AutoReply: [PATCH] has_plan('any') to report a skip_all plan
Date: Mon, 4 Jun 2007 10:56:51 -0300
To: bug-Test-Simple [...] rt.cpan.org, perl-qa [...] perl.org
From: "Adriano Ferreira" <a.r.ferreira [...] gmail.com>
Oh, shame! It seems like I never attached the promised patch to this ticket. That has something to do with why I never had an answer from Michael or chromatic? ;-) So I attach it now and forward this also to perl-qa as well. Another possible idea is to leave ->has_plan as it is and add a new method ->has_any_plan documented as follows: =item B<has_plan> $plan = $Test->has_plan; Find out whether a plan has been defined. $plan is either C<undef> (no plan has been set), C<no_plan> (indeterminate # of tests), or an integer (the number of expected tests). Skip_all plans are handled as if no plan was set (but see C<has_any_plan>). =cut [snip] [code of has_plan is unchanged] =item B<has_any_plan> $plan = $Test->has_any_plan; Find out whether a plan has been defined. It works as C<has_plan> but for C<skip_all> plans, it returns C<skip_all>. =cut sub has_any_plan { my $self = shift; return('skip_all') if $self->{Skip_All}; return $self->has_plan; } Comments? Ok, returning to Warnock state (this time it would not be my sole fault as there is a patch now for real). Adriano Ferreira On 4/24/07, Bugs in Test-Simple via RT <bug-Test-Simple@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "[PATCH] has_plan('any') to report a skip_all plan", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #26615]. Your ticket is accessible > on the web at: > > http://rt.cpan.org/Ticket/Display.html?id=26615 > > Please include the string: > > [rt.cpan.org #26615] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-Test-Simple@rt.cpan.org > > ------------------------------------------------------------------------- > The attached patch is meant to solve the problem of determining if > any of these statements were executed under the current Test::Builder > instance > > $builder->plan( tests => $n ); > $builder->plan( 'no_plan' ); > $builder->plan( skip_all => $reason ); > > The first two may be determined looking at the return of > > $builder->has_plan; > > But that is not the case for the skip_all plan. Actually you'll have to > look at the internal attribute $builder->{Skip_All} to determine this. > > I started a thread at perl-qa@perl.org about this and got responses from Ovid > and Adrian Howard that made me see that although skip_all looks > like a plan, it is special anyway. > > http://www.nntp.perl.org/group/perl.qa/2007/04/msg8583.html > > So my proposal is to leave " $builder->has_plan " as it is, but augment > its behavior if an explicit argument 'any' was given. > > $builder->has_plan('any') => the expected number of tests, or > => 'no_plan' or > => 'skip_all' > > I've touched the documentation as well. If this patch is not accepted, > at the least the phrase "Skip_all plans are handled as if no plan was set." > may be added to the has_plan description. > > I've also inserted another test into t/skipall.t to check " has_plan('any') " > works. > > Best regards, > Adriano Ferreira. > >

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #26615] AutoReply: [PATCH] has_plan('any') to report a skip_all plan
Date: Tue, 4 Sep 2007 15:11:29 -0300
To: bug-Test-Simple [...] rt.cpan.org
From: "Adriano Ferreira" <a.r.ferreira [...] gmail.com>
On 6/4/07, Adriano Ferreira <a.r.ferreira@gmail.com> wrote: Show quoted text
> Oh, shame! It seems like I never attached the promised patch to this > ticket. That has something to do with why I never had an answer from > Michael or chromatic? ;-) > > So I attach it now and forward this also to perl-qa as well. Another > possible idea is to leave ->has_plan as it is and add a new method > ->has_any_plan documented as follows: > > > =item B<has_plan> > > $plan = $Test->has_plan; > > Find out whether a plan has been defined. $plan is either C<undef> > (no plan has been set), C<no_plan> (indeterminate # of tests), > or an integer (the number of expected tests). > Skip_all plans are handled as if no plan was set (but see > C<has_any_plan>). > > =cut > > [snip] [code of has_plan is unchanged] > > =item B<has_any_plan> > > $plan = $Test->has_any_plan; > > Find out whether a plan has been defined. It works as C<has_plan> > but for C<skip_all> plans, it returns C<skip_all>. > > =cut > > sub has_any_plan { > my $self = shift; > > return('skip_all') if $self->{Skip_All}; > return $self->has_plan; > } > > Comments? Ok, returning to Warnock state (this time it would not be my > sole fault as there is a patch now for real). > > Adriano Ferreira > > On 4/24/07, Bugs in Test-Simple via RT <bug-Test-Simple@rt.cpan.org> wrote:
> > > > Greetings, > > > > This message has been automatically generated in response to the > > creation of a trouble ticket regarding: > > "[PATCH] has_plan('any') to report a skip_all plan", > > a summary of which appears below. > > > > There is no need to reply to this message right now. Your ticket has been > > assigned an ID of [rt.cpan.org #26615]. Your ticket is accessible > > on the web at: > > > > http://rt.cpan.org/Ticket/Display.html?id=26615 > > > > Please include the string: > > > > [rt.cpan.org #26615] > > > > in the subject line of all future correspondence about this issue. To do so, > > you may reply to this message. > > > > Thank you, > > bug-Test-Simple@rt.cpan.org > > > > ------------------------------------------------------------------------- > > The attached patch is meant to solve the problem of determining if > > any of these statements were executed under the current Test::Builder > > instance > > > > $builder->plan( tests => $n ); > > $builder->plan( 'no_plan' ); > > $builder->plan( skip_all => $reason ); > > > > The first two may be determined looking at the return of > > > > $builder->has_plan; > > > > But that is not the case for the skip_all plan. Actually you'll have to > > look at the internal attribute $builder->{Skip_All} to determine this. > > > > I started a thread at perl-qa@perl.org about this and got responses from Ovid > > and Adrian Howard that made me see that although skip_all looks > > like a plan, it is special anyway. > > > > http://www.nntp.perl.org/group/perl.qa/2007/04/msg8583.html > > > > So my proposal is to leave " $builder->has_plan " as it is, but augment > > its behavior if an explicit argument 'any' was given. > > > > $builder->has_plan('any') => the expected number of tests, or > > => 'no_plan' or > > => 'skip_all' > > > > I've touched the documentation as well. If this patch is not accepted, > > at the least the phrase "Skip_all plans are handled as if no plan was set." > > may be added to the has_plan description. > > > > I've also inserted another test into t/skipall.t to check " has_plan('any') " > > works. > > > > Best regards, > > Adriano Ferreira. > > > >
> >
ping
On Tue Sep 04 11:12:07 2007, a.r.ferreira@gmail.com wrote: Show quoted text
> On 6/4/07, Adriano Ferreira <a.r.ferreira@gmail.com> wrote:
> > Oh, shame! It seems like I never attached the promised patch to this > > ticket. That has something to do with why I never had an answer from > > Michael or chromatic? ;-) > > > > So I attach it now and forward this also to perl-qa as well. Another > > possible idea is to leave ->has_plan as it is and add a new method > > ->has_any_plan documented as follows: > > > > > > =item B<has_plan> > > > > $plan = $Test->has_plan; > > > > Find out whether a plan has been defined. $plan is either C<undef> > > (no plan has been set), C<no_plan> (indeterminate # of tests), > > or an integer (the number of expected tests). > > Skip_all plans are handled as if no plan was set (but see > > C<has_any_plan>). > > > > =cut > > > > [snip] [code of has_plan is unchanged] > > > > =item B<has_any_plan> > > > > $plan = $Test->has_any_plan; > > > > Find out whether a plan has been defined. It works as C<has_plan> > > but for C<skip_all> plans, it returns C<skip_all>. > > > > =cut > > > > sub has_any_plan { > > my $self = shift; > > > > return('skip_all') if $self->{Skip_All}; > > return $self->has_plan; > > } > > > > Comments? Ok, returning to Warnock state (this time it would not be > > my > > sole fault as there is a patch now for real). > > > > Adriano Ferreira > > > > On 4/24/07, Bugs in Test-Simple via RT <bug-Test-Simple@rt.cpan.org> > > wrote:
> > > > > > Greetings, > > > > > > This message has been automatically generated in response to the > > > creation of a trouble ticket regarding: > > > "[PATCH] has_plan('any') to report a skip_all plan", > > > a summary of which appears below. > > > > > > There is no need to reply to this message right now. Your ticket > > > has been > > > assigned an ID of [rt.cpan.org #26615]. Your ticket is accessible > > > on the web at: > > > > > > http://rt.cpan.org/Ticket/Display.html?id=26615 > > > > > > Please include the string: > > > > > > [rt.cpan.org #26615] > > > > > > in the subject line of all future correspondence about this issue. > > > To do so, > > > you may reply to this message. > > > > > > Thank you, > > > bug-Test-Simple@rt.cpan.org > > > > > > ------------------------------------------------------------------------- > > > The attached patch is meant to solve the problem of determining if > > > any of these statements were executed under the current > > > Test::Builder > > > instance > > > > > > $builder->plan( tests => $n ); > > > $builder->plan( 'no_plan' ); > > > $builder->plan( skip_all => $reason ); > > > > > > The first two may be determined looking at the return of > > > > > > $builder->has_plan; > > > > > > But that is not the case for the skip_all plan. Actually you'll > > > have to > > > look at the internal attribute $builder->{Skip_All} to determine > > > this. > > > > > > I started a thread at perl-qa@perl.org about this and got responses > > > from Ovid > > > and Adrian Howard that made me see that although skip_all looks > > > like a plan, it is special anyway. > > > > > > http://www.nntp.perl.org/group/perl.qa/2007/04/msg8583.html > > > > > > So my proposal is to leave " $builder->has_plan " as it is, but > > > augment > > > its behavior if an explicit argument 'any' was given. > > > > > > $builder->has_plan('any') => the expected number of tests, or > > > => 'no_plan' or > > > => 'skip_all' > > > > > > I've touched the documentation as well. If this patch is not > > > accepted, > > > at the least the phrase "Skip_all plans are handled as if no plan > > > was set." > > > may be added to the has_plan description. > > > > > > I've also inserted another test into t/skipall.t to check " > > > has_plan('any') " > > > works. > > > > > > Best regards, > > > Adriano Ferreira. > > > > > >
> > > >
> > ping
Test2::API gives you the ability to check and see what if any plan is set, and all cases can be deduced.