Mercurial > hg
diff tests/test-simplemerge.py @ 48562:12ac4401ff7d
simplemerge: simplify and rename `render_markers()`
`render_markers()` now always renders minimized 2-way markers, so
let's simplify and rename it accordingly.
Differential Revision: https://phab.mercurial-scm.org/D11979
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 11 Jan 2022 21:56:27 -0800 |
parents | 2dbee604a4f0 |
children | 7ed4c4753891 |
line wrap: on
line diff
--- a/tests/test-simplemerge.py Tue Jan 11 16:23:10 2022 -0800 +++ b/tests/test-simplemerge.py Tue Jan 11 21:56:27 2022 -0800 @@ -180,7 +180,7 @@ self.assertEqual(list(m3.merge_regions()), [(b'a', 0, 2)]) self.assertEqual( - simplemerge.render_markers(m3), ([b'aaa', b'bbb'], False) + simplemerge.render_minimized(m3), ([b'aaa', b'bbb'], False) ) def test_no_conflicts(self): @@ -207,7 +207,7 @@ ) self.assertEqual( - b''.join(simplemerge.render_markers(m3)[0]), b'aaa\nbbb\n222\n' + b''.join(simplemerge.render_minimized(m3)[0]), b'aaa\nbbb\n222\n' ) def test_append_b(self): @@ -218,7 +218,7 @@ ) self.assertEqual( - b''.join(simplemerge.render_markers(m3)[0]), b'aaa\nbbb\n222\n' + b''.join(simplemerge.render_minimized(m3)[0]), b'aaa\nbbb\n222\n' ) def test_append_agreement(self): @@ -229,7 +229,7 @@ ) self.assertEqual( - b''.join(simplemerge.render_markers(m3)[0]), b'aaa\nbbb\n222\n' + b''.join(simplemerge.render_minimized(m3)[0]), b'aaa\nbbb\n222\n' ) def test_append_clash(self): @@ -239,7 +239,7 @@ [b'aaa\n', b'bbb\n', b'333\n'], ) - ml, conflicts = simplemerge.render_markers( + ml, conflicts = simplemerge.render_minimized( m3, name_a=b'a', name_b=b'b', @@ -259,7 +259,7 @@ [b'aaa\n', b'222\n', b'bbb\n'], ) - ml, conflicts = simplemerge.render_markers( + ml, conflicts = simplemerge.render_minimized( m3, name_a=b'a', name_b=b'b', @@ -300,7 +300,7 @@ ], ) - ml, conflicts = simplemerge.render_markers( + ml, conflicts = simplemerge.render_minimized( m3, name_a=b'a', name_b=b'b', @@ -349,7 +349,7 @@ def test_merge_poem(self): """Test case from diff3 manual""" m3 = Merge3(TZU, LAO, TAO) - ml, conflicts = simplemerge.render_markers(m3, b'LAO', b'TAO') + ml, conflicts = simplemerge.render_minimized(m3, b'LAO', b'TAO') self.log(b'merge result:') self.log(b''.join(ml)) self.assertEqual(ml, MERGED_RESULT) @@ -367,7 +367,7 @@ other_text.splitlines(True), this_text.splitlines(True), ) - m_lines, conflicts = simplemerge.render_markers(m3, b'OTHER', b'THIS') + m_lines, conflicts = simplemerge.render_minimized(m3, b'OTHER', b'THIS') self.assertEqual( b'<<<<<<< OTHER\r\nc\r\n=======\r\nb\r\n' b'>>>>>>> THIS\r\n'.splitlines(True), @@ -383,7 +383,7 @@ other_text.splitlines(True), this_text.splitlines(True), ) - m_lines, conflicts = simplemerge.render_markers(m3, b'OTHER', b'THIS') + m_lines, conflicts = simplemerge.render_minimized(m3, b'OTHER', b'THIS') self.assertEqual( b'<<<<<<< OTHER\rc\r=======\rb\r' b'>>>>>>> THIS\r'.splitlines(True),