Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML-LibYAML CPAN distribution.

Report information
The Basics
Id: 42353
Status: rejected
Priority: 1/
Queue: YAML-LibYAML

People
Owner: Nobody in particular
Requestors: DEEPFRYED [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.32
Fixed in: (no value)



Subject: merge keys not working
Hi, Merging keys does not work correctly as per the given test. This seems to work in libyaml bundled with python. import yaml print yaml.load(""" # example yaml file. --- foo: &100 bar: 1 baz: 2 bar: <<: *100 baz: key1: 1 key2: 2 <<: key3: 3 """) outputs {'bar': {'bar': 1, 'baz': 2}, 'foo': {'bar': 1, 'baz': 2}, 'baz': {'key3': 3, 'key2': 2, 'key1': 1}}
Subject: merge_keys.t
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 3; use Test::NoWarnings; use_ok('YAML::XS'); is_deeply( Load( join $/, (<DATA>) ), { foo => { bar => 1, baz => 2 }, bar => { bar => 1, baz => 2 }, baz => { key1 => 1, key2 => 2, key3 => 3 } }, 'merge works correctly' ); __DATA__ # example yaml file. --- foo: &100 bar: 1 baz: 2 bar: <<: *100 baz: key1: 1 key2: 2 <<: key3: 3
Hi, merge keys are not part of the YAML specification. I guess it's not libyaml but PyYAML doing this. I'm closing this.