Subject: Re: [tap] [tap-l] questions regarding draft standard compliance

From: EBo <[email-masked]>
Date: Fri, 27 Aug 2010 08:44:30 -0600

>> 2) Should I report here, to tap-l, discrepancies from  Test-Harness
>> divinations from the draft standard?  Or should I take that  off-list
to
>> the
>> maintainers?  The case in point is a descriptive  string in
Test-Harness
>> which is not Safe-String compliant.  Normally, I  would take this
>> directly
>> to the maintainers, but it is my understanding that  Test-Harness is
the
>> exemplar for the IETF draft standard, and thought these  issues fodder
>> for
>> general discussion.
> 
> I don't mind seeing the discussion here, though there's also an IETF 
> list: [email-masked]

Thanks Ovid, I have CC'ed [email-masked] to solicit additional comments on
their end.

>> 1) is  the draft standard for the SKIP and TODO directives to be  case
>> sensitive?
> 
> They should not be case-sensitive.  As a general rule of thumb (there
are 
> exceptions), if the standard deviates from the behaviour of
Test::Harness,
> it 
> means the standard needs to be corrected.  This is because we have, on
> several 
> occasions, discovered that the official Test::Harness for Perl has, for
> years, 
> permitted unexpected behaviour.  Thus, we tend to say that the code is
the 
> actual standard in order to avoid breaking backwards-compatibility.

OK.  I would have thought that the IETF standard would be an attempt to
repair oddities in future versions of Test::Harness than to document it as
canonical source.  Otherwise why would they explicitly set up a Safe-String
in their grammar if you can include escape \# (see test 36 from
t/source_handler.t).  Fortunately in 11,000+ test results, only one appears
to violate this IETF grammar rule.

On the IETF side, what are your thoughts on this matter?

> In this case, you can look at the code for the grammar:
> 
>  
http://cpansearch.perl.org/src/ANDYA/Test-Harness-3.22/lib/TAP/Parser/Grammar.pm
> 
> 
> And you should note the following:
> 
>                 if ($desc =~ m/^ ( [^\\\#]* (?: \\. [^\\\#]* )* )
>                        \# \s* (SKIP|TODO) \b \s* (.*) $/ix
>                   )
>                 {
>                     ( $desc, $dir, $explanation ) = ( $1, $2, $3 );
>                 }
> 
> That clearly shows that the directives are case-insensitive ("TodO" is
> allowed, 
> for example) and even the space between the hash (#) and the directive
is 
> optional (though it's interesting that no space is required after.  "not
> ok 1 
> #TodO-whee!" is a valid TODO test. I think I wrote that regex, so this
> might be 
> my fault).

The optional space is a minor issue and can be easily accounted for by
correcting the IETF standard, but I was more concerned by the Safe-String
rule violation.

On the IETF side, how do you want to deal with SP in the grammar?

> Still, it's better to ask if you're in doubt.

Thanks and best regards,

  EBo --