A. Pagaltzis wrote:
> * Michael G Schwern <[EMAIL PROTECTED]> [2007-12-06 06:35]:
>> Right now you have to write this:
>>
>>   use Test::More;
>>
>>   if( $^O eq 'SomeOS' ) {
>>       plan skip_all => "Tests don't apply to SomeOS":
>>   }
>>   else {
>>       plan tests => 3;
>>   }
>>
>> It's ugly and verbose and the decision to skip all has to come
>> before you do any testing at all.
> 
> Btw, I always do that like this:
> 
>     use Test::More;
>   
>     plan $^O eq 'SomeOS'
>         ? skip_all => "Tests don't apply to SomeOS"
>         : tests => 3;

the way Apache::Test and Test::Plan handle this is

 plan tests => 3, $plan_if_true;

which is even better... and with precedent.

feel free to fold in the Test::Plan functionality :)

  http://search.cpan.org/dist/Test-Plan/lib/Test/Plan.pm

--Geoff

Reply via email to