~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Jelmer Vernooij
  • Date: 2011-06-20 11:03:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5991.
  • Revision ID: jelmer@samba.org-20110620110353-bvpclti665on0wyg
Fix GraphThunkIdsToKeys.merge_sort

Show diffs side-by-side

added added

removed removed

Lines of Context:
1646
1646
        self.assertEqual(['B', 'D'],
1647
1647
            sorted(graph_thunk.heads(['D', 'B', 'A'])))
1648
1648
 
 
1649
    def test_merge_sort(self):
 
1650
        d = {('C',):[('A',)], ('B',): [('A',)], ('A',): []}
 
1651
        g = _mod_graph.KnownGraph(d)
 
1652
        graph_thunk = _mod_graph.GraphThunkIdsToKeys(g)
 
1653
        graph_thunk.add_node("D", ["A", "C"])
 
1654
        self.assertEqual([('C', 0, (2,), False), ('A', 0, (1,), True)],
 
1655
            [(n.key, n.merge_depth, n.revno, n.end_of_merge)
 
1656
                 for n in graph_thunk.merge_sort('C')])
 
1657
 
1649
1658
 
1650
1659
class TestPendingAncestryResultGetKeys(TestCaseWithMemoryTransport):
1651
1660
    """Tests for bzrlib.graph.PendingAncestryResult."""