Ovid wrote:
> So I now have well over 2,000 tests for the parser, but there's a corner case 
> that's killing me.  Test::Harness handles it fine, so I'm thinking that the 
> TAP specification (and subsequent grammar) is wrong.
> 
> In the Perl core, we have t/base/rs.t and on line 129 of that file we have 
> the following:
> 
>     foreach $test (11..14) {print "ok $test # skipped on non-VMS system\n"};
> 
> That unescaped hash mark is causing me lots of pain.

Because its not an unescaped hash mark.  Its an old school skip directive.  And 
there's a lot of them floating around in the core tests.  grep for /# skipp/i 
and you'll see a bunch.

Test::Harness is (was) pretty liberal about what it accepts as a skip 
directive.  Pretty much /^skip/i will do.  You can see this clearer in older 
versions.  For example, the 1.18 docs say:

 =item B<Skipping tests>

 If the standard output line contains the substring C< # Skip> (with
 variations in spacing and case) after C<ok> or C<ok NUMBER>, it is
 counted as a skipped test.  If the whole testscript succeeds, the
 count of skipped tests is included in the generated output.
 C<Test::Harness> reports the text after C< # Skip\S*\s+> as a reason
 for skipping.  

  ok 23 # skip Insufficient flogiston pressure.

 Similarly, one can include a similar explanation in a C<1..0> line
 emitted if the test script is skipped completely:

  1..0 # Skipped: no leverage found

This compatibility may have been broken in t/TEST but nobody noticed since the 
test still passes.

                            # SKIP is essentially the same as TODO for t/TEST
                            # this still conforms to TAP:
                            # 
http://search.cpan.org/dist/Test-Harness/lib/Test/Harness/TAP.pod
                            $extra and $istodo = $extra =~ 
/#\s*(?:TODO|SKIP)\b/;

Its also broken in the recent Test::Harness, they are not recognized as skips 
and there are no tests for them.

I'm willing to bet there's a number of them still floating around in the wild.  
Up to you if you want to support it or whether it should go forward into TAP.  
As demonstrated by the lack of anyone having noticed until now, there's little 
harm in dropping support for it.

Reply via email to