~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_multiparent.py

  • Committer: Daniel Watkins
  • Date: 2007-08-02 18:04:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2705.
  • Revision ID: d.m.watkins@warwick.ac.uk-20070802180435-cs6xalg5tkze209b
tests.blackbox.test_aliases now uses internals where appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
from unittest import TestCase
18
18
 
49
49
                          multiparent.ParentText(0, 1, 2, 3)],
50
50
                         diff.hunks)
51
51
 
52
 
        diff = multiparent.MultiParent.from_lines(LINES_2, [LINES_1])
53
 
        self.assertEqual([multiparent.ParentText(0, 0, 0, 1),
54
 
                          multiparent.ParentText(0, 2, 1, 3)],
55
 
                         diff.hunks)
56
 
 
57
52
    def test_compare_two_parents(self):
58
53
        diff = multiparent.MultiParent.from_lines(LINES_1, [LINES_2, LINES_3])
59
54
        self.assertEqual([multiparent.ParentText(1, 0, 0, 4),
69
64
                          multiparent.ParentText(0, 3, 4, 1)],
70
65
                         diff.hunks)
71
66
 
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
 
 
81
67
    def test_range_iterator(self):
82
68
        diff = multiparent.MultiParent.from_lines(LINES_1, [LINES_2, LINES_3])
83
69
        diff.hunks.append(multiparent.NewText(['q\n']))