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