Subject: | TAP::Parser chokes on YAMLish header "--- " (with trailing whitespace) |
If I output TAP with embedded YAMLish and
have a whitespace after the "---" then TAP::Parser
chokes and does not continue.
1. IMHO it should allow whitespace there.
This happens quite a lot here to people generating TAP
manually.
2. IMHO TAP::Parser generally should not stop on YAML parse
errors but continue and ignore the YAML as it ignores unknown
TAP lines.
Again, this is important when I receive non-Perl
but manually generated TAP with lots of other program output
intermixed where such garbage can happen.
Example:
-------------- snip -------------------
#! /usr/bin/env perl
print "
TAP Version 13
1..3
ok - aaa
ok - bbb
---
foo: bar
...
ok - ccc
"
-------------- snap -------------------
Running prove:
$ prove -l t/yamlish_whitespace_after_header.t
t/yamlish_whitespace_after_header.t .. Failed 1/3 subtests
Test Summary Report
-------------------
Use of uninitialized value in sprintf at
/2home/ss5/perl510/lib/5.10.0/TAP/Formatter/Base.pm line 373.
t/yamlish_whitespace_after_header.t (Wstat: 0 Tests: 2 Failed: 0)
Parse errors: Missing '...' at end of YAMLish at
/2home/ss5/perl510/lib/5.10.0/TAP/Parser/YAMLish/Reader.pm line 50.
Bad plan. You planned 3 tests but ran 2.
Files=1, Tests=2, 0 wallclock secs ( 0.10 usr + 0.02 sys = 0.12 CPU)
Result: FAIL
To be sure about the whitespace I also attach the script.
Thanks and kind regards,
Steffen
--
Steffen Schwigon <ss5@renormalist.net>
Dresden Perl Mongers <http://dresden-pm.org/>
Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Subject: | yamlish_whitespace_after_header.t |
#! /usr/bin/env perl
print "
TAP Version 13
1..3
ok - aaa
ok - bbb
---
foo: bar
...
ok - ccc
"