~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-06-16 13:28:38 UTC
  • mto: (2520.5.2 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: aaron.bentley@utoronto.ca-20070616132838-3epgsvjr4tealar8
Accelerate mpdiff generation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from unittest import TestCase
2
2
 
3
3
from bzrlib import (
 
4
    knit,
4
5
    multiparent,
 
6
    patiencediff,
5
7
    tests,
6
8
    )
7
9
 
37
39
                          multiparent.ParentText(0, 3, 4, 1)],
38
40
                         diff.hunks)
39
41
 
 
42
    def test_compare_two_parents_blocks(self):
 
43
        matcher = patiencediff.PatienceSequenceMatcher(None, LINES_2, LINES_1)
 
44
        blocks = matcher.get_matching_blocks()
 
45
        diff = multiparent.MultiParent.from_lines(LINES_1, [LINES_2, LINES_3],
 
46
                                                  left_blocks=blocks)
 
47
        self.assertEqual([multiparent.ParentText(1, 0, 0, 4),
 
48
                          multiparent.ParentText(0, 3, 4, 1)],
 
49
                         diff.hunks)
 
50
 
40
51
    def test_range_iterator(self):
41
52
        diff = multiparent.MultiParent.from_lines(LINES_1, [LINES_2, LINES_3])
42
53
        diff.hunks.append(multiparent.NewText(['q\n']))