/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: John Arbash Meinel
  • Date: 2006-04-25 15:05:42 UTC
  • mfrom: (1185.85.85 bzr-encoding)
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: john@arbash-meinel.com-20060425150542-c7b518dca9928691
[merge] the old bzr-encoding changes, reparenting them on bzr.dev

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
# 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)
28
26
    def test_conflict(self):
29
27
        lines_a = "a\nb\nc\nd\ne\nf\ng\nh\n".splitlines(True)
30
28
        lines_b = "z\nb\nx\nd\ne\ne\nf\ng\ny\n".splitlines(True)
31
 
        expected = "<\na\n=\nz\n>\nb\n<\nc\n=\nx\n>\nd\ne\n<\n=\ne\n>\nf\n"\
 
29
        expected = "<\na\n=\nz\n>\nb\n<\nc\n=\nx\n>\nd\n<\n=\ne\n>\ne\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)