Open szabgab opened 8 years ago
FYI YAML::Syck and YAML::Tiny behave like YAML::XS in this and in #152 See http://perlmaven.com/yaml-vs-yaml-xs-inconsistencies
Chokes on dash as well
#!perl
use strict;
use warnings;
use YAML ();
use YAML::XS ();
use YAML::Syck ();
use Data::Dumper;
my $conf = <<'TEST';
---
foo:
- bar:
- -baz
TEST
test( $_ ) for qw(
YAML
YAML::XS
YAML::Syck
);
sub test {
my $what = shift;
my $func = \&{ $what . '::Load' };
eval {
printf "%s v%s:\n", $what, $what->VERSION;
print Dumper $func->( $conf );
1;
} or print "FAIL($what): $@\n";
}
output:
$ perl t.pl
YAML v1.24:
FAIL(YAML): YAML Error: Invalid element in map
Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
Line: 4
Document: 1
at /Users/bgursoy/.plenv/versions/5.26.0/lib/perl5/site_perl/5.26.0/YAML/Loader.pm line 351.
YAML::XS v0.66:
$VAR1 = {
'foo' => [
{
'bar' => [
'-baz'
]
}
]
};
YAML::Syck v1.30:
$VAR1 = {
'foo' => [
{
'bar' => [
'-baz'
]
}
]
};
I found a case that YAML 1.15 parse and YAML::XS 0.59 throws exception: A minimal version is: