Andy Armstrong wrote:
> I've added logic that produces output like this:
> 
> 13:54] andy $ prove t/sample-tests/skipall t/sample-tests/ 
> skipall_nomsg t/sample-tests/simple
> t/sample-tests/skipall..........skipped: rope
> t/sample-tests/skipall_nomsg....skipped: (no reason given)
> t/sample-tests/simple...........ok
> All tests successful.
> Files=3, Tests=5,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.01 cusr   
> 0.00 csys =  0.03 CPU)
> Result: PASS
> 
> Do we like that?

Test::Harness 2 put it on it's own line mostly to avoid wrapping off the right
side of the screen.  I still lean in that direction.


>> However, TAP::Parser doesn't seem to have a &skip_all method  
>> (returning boolean or explanation?  What if no skip reason given?).
> 
> TAP::Parser->skip_all returns a true value if all tests are skipped.  
> It either returns the skip reason or '(no reason given)' as above.

I don't like that it hard wires the default string, that's mixing up display
with the API.  It leaves developers having to write weird things like "if(
$skip eq '(no reason given)' ) { ...then put in your own default... }".

This is a situation where "0 but true" becomes handy.  Or in this case, '' but
true.  It might make sense, in the case where there is no reason given, to
return a boolean and string overloaded object which returns false for bool and
the empty string as a string.

It occurs to me that an "X but true" CPAN module would be handy.


-- 
Don't try the paranormal until you know what's normal.
        -- "Lords and Ladies" by Terry Prachett

Reply via email to