/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 breezy/tests/test_textmerge.py

  • Committer: Jelmer Vernooij
  • Date: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

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 bzrlib.textmerge import Merge2
19
 
from bzrlib.tests import TestCase
 
18
from breezy.textmerge import Merge2
 
19
from breezy.tests import TestCase
 
20
 
 
21
 
20
22
class TestMerge2(TestCase):
21
23
    def test_agreed(self):
22
24
        lines = "a\nb\nc\nd\ne\nf\n".splitlines(True)
29
31
        expected = "<\na\n=\nz\n>\nb\n<\nc\n=\nx\n>\nd\ne\n<\n=\ne\n>\nf\n"\
30
32
                   "g\n<\nh\n=\ny\n>\n"
31
33
        m2 = Merge2(lines_a, lines_b, '<\n', '>\n', '=\n')
32
 
        mlines= m2.merge_lines()[0]
 
34
        mlines = m2.merge_lines()[0]
33
35
        self.assertEqualDiff(''.join(mlines), expected)
34
 
        mlines= m2.merge_lines(reprocess=True)[0]
 
36
        mlines = m2.merge_lines(reprocess=True)[0]
35
37
        self.assertEqualDiff(''.join(mlines), expected)
36
38
 
37
39
    def test_reprocess(self):
38
 
        struct = [('a', 'b'), ('c',), ('def','geh'), ('i',)]
 
40
        struct = [('a', 'b'), ('c',), ('def', 'geh'), ('i',)]
39
41
        expect = [('a', 'b'), ('c',), ('d', 'g'), ('e',), ('f', 'h'), ('i',)]
40
42
        result = Merge2.reprocess_struct(struct)
41
43
        self.assertEqual(list(result), expect)