/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_textmerge.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
#
17
17
# Author: Aaron Bentley <aaron.bentley@utoronto.ca>
18
 
from breezy.textmerge import Merge2
19
 
from breezy.tests import TestCase
20
 
 
21
 
 
 
18
from bzrlib.textmerge import Merge2
 
19
from bzrlib.tests import TestCase
22
20
class TestMerge2(TestCase):
23
21
    def test_agreed(self):
24
22
        lines = "a\nb\nc\nd\ne\nf\n".splitlines(True)
31
29
        expected = "<\na\n=\nz\n>\nb\n<\nc\n=\nx\n>\nd\ne\n<\n=\ne\n>\nf\n"\
32
30
                   "g\n<\nh\n=\ny\n>\n"
33
31
        m2 = Merge2(lines_a, lines_b, '<\n', '>\n', '=\n')
34
 
        mlines = m2.merge_lines()[0]
 
32
        mlines= m2.merge_lines()[0]
35
33
        self.assertEqualDiff(''.join(mlines), expected)
36
 
        mlines = m2.merge_lines(reprocess=True)[0]
 
34
        mlines= m2.merge_lines(reprocess=True)[0]
37
35
        self.assertEqualDiff(''.join(mlines), expected)
38
36
 
39
37
    def test_reprocess(self):
40
 
        struct = [('a', 'b'), ('c',), ('def', 'geh'), ('i',)]
 
38
        struct = [('a', 'b'), ('c',), ('def','geh'), ('i',)]
41
39
        expect = [('a', 'b'), ('c',), ('d', 'g'), ('e',), ('f', 'h'), ('i',)]
42
40
        result = Merge2.reprocess_struct(struct)
43
41
        self.assertEqual(list(result), expect)