~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__known_graph.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-12 18:05:15 UTC
  • mto: (4371.4.5 vila-better-heads)
  • mto: This revision was merged to the branch mainline in revision 4449.
  • Revision ID: john@arbash-meinel.com-20090612180515-t0cwbjsnve094oik
Add a failing test for handling nodes that are in the same linear chain.

It fails because the ancestry skipping causes us to miss the fact that the two nodes
are actually directly related. We could check at the beginning, as the 
code used to do, but I think that will be incomplete for the more-than-two
heads cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
        self.assertEqual(set(['rev2c', 'rev3a']),
225
225
                         graph.heads(['rev2c', 'rev3a']))
226
226
 
227
 
 
228
 
 
 
227
    def test_heads_linear(self):
 
228
        graph = self.make_known_graph(test_graph.racing_shortcuts)
 
229
        self.assertEqual(set(['w']), graph.heads(['w', 's']))
 
230
        self.assertEqual(set(['z']), graph.heads(['w', 's', 'z']))
 
231
        self.assertEqual(set(['w', 'q']), graph.heads(['w', 's', 'q']))