Mercurial > hg
diff tests/test-simplemerge.py @ 48558:2dbee604a4f0
simplemerge: clarify names of functions that render conflict markers
Differential Revision: https://phab.mercurial-scm.org/D11975
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 11 Jan 2022 16:54:42 -0800 |
parents | c6649c53073f |
children | 12ac4401ff7d |
line wrap: on
line diff
--- a/tests/test-simplemerge.py Fri Jan 07 22:16:22 2022 -0800 +++ b/tests/test-simplemerge.py Tue Jan 11 16:54:42 2022 -0800 @@ -179,7 +179,9 @@ self.assertEqual(list(m3.merge_regions()), [(b'a', 0, 2)]) - self.assertEqual(simplemerge.merge_lines(m3), ([b'aaa', b'bbb'], False)) + self.assertEqual( + simplemerge.render_markers(m3), ([b'aaa', b'bbb'], False) + ) def test_no_conflicts(self): """No conflicts because only one side changed""" @@ -205,7 +207,7 @@ ) self.assertEqual( - b''.join(simplemerge.merge_lines(m3)[0]), b'aaa\nbbb\n222\n' + b''.join(simplemerge.render_markers(m3)[0]), b'aaa\nbbb\n222\n' ) def test_append_b(self): @@ -216,7 +218,7 @@ ) self.assertEqual( - b''.join(simplemerge.merge_lines(m3)[0]), b'aaa\nbbb\n222\n' + b''.join(simplemerge.render_markers(m3)[0]), b'aaa\nbbb\n222\n' ) def test_append_agreement(self): @@ -227,7 +229,7 @@ ) self.assertEqual( - b''.join(simplemerge.merge_lines(m3)[0]), b'aaa\nbbb\n222\n' + b''.join(simplemerge.render_markers(m3)[0]), b'aaa\nbbb\n222\n' ) def test_append_clash(self): @@ -237,7 +239,7 @@ [b'aaa\n', b'bbb\n', b'333\n'], ) - ml, conflicts = simplemerge.merge_lines( + ml, conflicts = simplemerge.render_markers( m3, name_a=b'a', name_b=b'b', @@ -257,7 +259,7 @@ [b'aaa\n', b'222\n', b'bbb\n'], ) - ml, conflicts = simplemerge.merge_lines( + ml, conflicts = simplemerge.render_markers( m3, name_a=b'a', name_b=b'b', @@ -298,7 +300,7 @@ ], ) - ml, conflicts = simplemerge.merge_lines( + ml, conflicts = simplemerge.render_markers( m3, name_a=b'a', name_b=b'b', @@ -347,7 +349,7 @@ def test_merge_poem(self): """Test case from diff3 manual""" m3 = Merge3(TZU, LAO, TAO) - ml, conflicts = simplemerge.merge_lines(m3, b'LAO', b'TAO') + ml, conflicts = simplemerge.render_markers(m3, b'LAO', b'TAO') self.log(b'merge result:') self.log(b''.join(ml)) self.assertEqual(ml, MERGED_RESULT) @@ -365,7 +367,7 @@ other_text.splitlines(True), this_text.splitlines(True), ) - m_lines, conflicts = simplemerge.merge_lines(m3, b'OTHER', b'THIS') + m_lines, conflicts = simplemerge.render_markers(m3, b'OTHER', b'THIS') self.assertEqual( b'<<<<<<< OTHER\r\nc\r\n=======\r\nb\r\n' b'>>>>>>> THIS\r\n'.splitlines(True), @@ -381,7 +383,7 @@ other_text.splitlines(True), this_text.splitlines(True), ) - m_lines, conflicts = simplemerge.merge_lines(m3, b'OTHER', b'THIS') + m_lines, conflicts = simplemerge.render_markers(m3, b'OTHER', b'THIS') self.assertEqual( b'<<<<<<< OTHER\rc\r=======\rb\r' b'>>>>>>> THIS\r'.splitlines(True),