| 1 |
=pod |
| 2 |
|
| 3 |
This is an example of a serious design flaw in CPAN::Meta::YAML. |
| 4 |
|
| 5 |
It is generally a bad idea to fake out a parsing process. In this case, |
| 6 |
CPAN::Meta::YAML strips off all lines that look like comments. |
| 7 |
|
| 8 |
It should be easy to find dozens of bugs by looking at the assumptions the code |
| 9 |
makes and then finding a counter case like this. |
| 10 |
|
| 11 |
That's why I'm working on Tiny::YAML and YAML::Pegex, which are driven by a |
| 12 |
grammar. |
| 13 |
|
| 14 |
=cut |
| 15 |
|
| 16 |
use Test::More tests => 1; |
| 17 |
use CPAN::Meta::YAML; |
| 18 |
|
| 19 |
TODO: { |
| 20 |
local $TODO = "Failing tests for things CPAN::Meta::YAML does wrong"; |
| 21 |
|
| 22 |
my $yaml = <<'...'; |
| 23 |
- | |
| 24 |
# Perl sub: |
| 25 |
sub foo {} |
| 26 |
... |
| 27 |
is Load($yaml)->[0], |
| 28 |
"# Perl sub:\nsub foo{}\n", |
| 29 |
"Comments in literal scalars"; |
| 30 |
} |