File: 86_fail.t

package info (click to toggle)
libyaml-tiny-perl 1.64-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 556 kB
  • ctags: 80
  • sloc: perl: 1,363; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 680 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
=pod

This is an example of a serious design flaw in YAML::Tiny.

It is generally a bad idea to fake out a parsing process. In this case,
YAML::Tiny strips off all lines that look like comments.

It should be easy to find dozens of bugs by looking at the assumptions the code
makes and then finding a counter case like this.

That's why I'm working on Tiny::YAML and YAML::Pegex, which are driven by a
grammar.

=cut

use Test::More tests => 1;
use YAML::Tiny;

TODO: {
local $TODO = "Failing tests for things YAML::Tiny does wrong";

my $yaml = <<'...';
- |
  # Perl sub:
  sub foo {}
...
is Load($yaml)->[0],
    "# Perl sub:\nsub foo{}\n",
    "Comments in literal scalars";
}