~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_multiparent.py

  • Committer: Aaron Bentley
  • Date: 2007-07-24 01:41:50 UTC
  • mto: This revision was merged to the branch mainline in revision 2699.
  • Revision ID: aaron.bentley@utoronto.ca-20070724014150-tk0u7xdx3b87xka1
SupportĀ Multiparent.get_matching_blocks

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                          multiparent.ParentText(0, 3, 4, 1)],
70
70
                         diff.hunks)
71
71
 
 
72
    def test_get_matching_blocks(self):
 
73
        diff = multiparent.MultiParent.from_lines(LINES_1, [LINES_2])
 
74
        self.assertEqual([(0, 0, 1), (1, 2, 3), (4, 5, 0)],
 
75
                         list(diff.get_matching_blocks(0, len(LINES_2))))
 
76
 
 
77
        diff = multiparent.MultiParent.from_lines(LINES_2, [LINES_1])
 
78
        self.assertEqual([(0, 0, 1), (2, 1, 3), (5, 4, 0)],
 
79
                         list(diff.get_matching_blocks(0, len(LINES_1))))
 
80
 
72
81
    def test_range_iterator(self):
73
82
        diff = multiparent.MultiParent.from_lines(LINES_1, [LINES_2, LINES_3])
74
83
        diff.hunks.append(multiparent.NewText(['q\n']))