diff options
author | Anthon van der Neut <anthon@mnt.org> | 2016-09-15 17:47:45 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2016-09-15 17:47:45 +0200 |
commit | 1dbffd0a290a757547da1bf9a98123b5b361b333 (patch) | |
tree | 3dd128f5d1ecd0e586437574a5a8a91a56691fad /_test | |
parent | 4682aff2579c954d79439f5dee6e1d848fe6ea58 (diff) | |
download | ruamel.yaml-1dbffd0a290a757547da1bf9a98123b5b361b333.tar.gz |
fix for issue #60, merges not printing correctly0.12.13
reported by Tal Liron
Diffstat (limited to '_test')
-rw-r--r-- | _test/test_comments.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/_test/test_comments.py b/_test/test_comments.py index b858fbc..f2aa1f0 100644 --- a/_test/test_comments.py +++ b/_test/test_comments.py @@ -491,6 +491,29 @@ class TestCommentedMapMerge: assert data['y']['a'] == 1 assert 'a' in data['y'] + def test_issue_60(self): + data = round_trip_load(""" + x: &base + a: 1 + y: + <<: *base + """) + assert data['x']['a'] == 1 + assert data['y']['a'] == 1 + assert str(data['y']) == """ordereddict([('a', 1)])""" + + def test_issue_60_1(self): + data = round_trip_load(""" + x: &base + a: 1 + y: + <<: *base + b: 2 + """) + assert data['x']['a'] == 1 + assert data['y']['a'] == 1 + assert str(data['y']) == """ordereddict([('b', 2), ('a', 1)])""" + class TestEmptyLines: # prompted by issue 46 from Alex Harvey |