~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testmerge3.py

  • Committer: Martin Pool
  • Date: 2005-07-05 08:48:02 UTC
  • Revision ID: mbp@sourcefrog.net-20050705084802-b1c1d199d28d04ea
- More merge3 cvs-form stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
class InsertClash(TestBase):
109
109
    """Both try to insert lines in the same place."""
110
110
    def runTest(self):
111
 
        m3 = Merge3(['aaa', 'bbb'],
112
 
                    ['aaa', '111', 'bbb'],
113
 
                    ['aaa', '222', 'bbb'])
 
111
        m3 = Merge3(['aaa\n', 'bbb\n'],
 
112
                    ['aaa\n', '111\n', 'bbb\n'],
 
113
                    ['aaa\n', '222\n', 'bbb\n'])
114
114
 
115
115
        self.assertEquals(m3.find_unconflicted(),
116
116
                          [(0, 1), (1, 2)])
126
126
                           ('unchanged', 1,2)])
127
127
 
128
128
        self.assertEquals(list(m3.merge_groups()),
129
 
                          [('unchanged', ['aaa']),
130
 
                           ('conflict', [], ['111'], ['222']),
131
 
                           ('unchanged', ['bbb']),
 
129
                          [('unchanged', ['aaa\n']),
 
130
                           ('conflict', [], ['111\n'], ['222\n']),
 
131
                           ('unchanged', ['bbb\n']),
132
132
                           ])
133
133
 
134
 
        self.assertEquals(list(m3.merge_lines('<<', '--', '>>')),
135
 
                          ['aaa',
136
 
                           '<<',
137
 
                           '111',
138
 
                           '--',
139
 
                           '222',
140
 
                           '>>',
141
 
                           'bbb'])
 
134
        ml = m3.merge_lines(name_a='a',
 
135
                            name_b='b',
 
136
                            start_marker='<<',
 
137
                            mid_marker='--',
 
138
                            end_marker='>>')
 
139
        self.assertEquals(''.join(ml),
 
140
'''aaa
 
141
<< a
 
142
111
 
143
--
 
144
222
 
145
>> b
 
146
bbb
 
147
''')
142
148
 
143
149
 
144
150