~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testmerge3.py

  • Committer: Aaron Bentley
  • Date: 2005-08-10 17:39:16 UTC
  • mto: (1092.1.41) (1185.3.4) (974.1.47)
  • mto: This revision was merged to the branch mainline in revision 1110.
  • Revision ID: abentley@panoramicfeedback.com-20050810173916-77580019d21a0e82
Removed MergeTree.inventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
18
 
from bzrlib.selftest import InTempDir, TestCase
 
18
from bzrlib.selftest import InTempDir, TestBase
19
19
from bzrlib.merge3 import Merge3
20
20
 
21
21
 
22
22
 
23
23
 
24
24
 
25
 
class NoChanges(TestCase):
 
25
class NoChanges(TestBase):
26
26
    """No conflicts because nothing changed"""
27
27
    def runTest(self):
28
28
        m3 = Merge3(['aaa', 'bbb'],
45
45
                          [('unchanged', ['aaa', 'bbb'])])
46
46
 
47
47
 
48
 
class FrontInsert(TestCase):
 
48
class FrontInsert(TestBase):
49
49
    def runTest(self):
50
50
        m3 = Merge3(['zz'],
51
51
                    ['aaa', 'bbb', 'zz'],
67
67
        
68
68
    
69
69
 
70
 
class NullInsert(TestCase):
 
70
class NullInsert(TestBase):
71
71
    def runTest(self):
72
72
        m3 = Merge3([],
73
73
                    ['aaa', 'bbb'],
86
86
        
87
87
    
88
88
 
89
 
class NoConflicts(TestCase):
 
89
class NoConflicts(TestBase):
90
90
    """No conflicts because only one side changed"""
91
91
    def runTest(self):
92
92
        m3 = Merge3(['aaa', 'bbb'],
108
108
 
109
109
 
110
110
 
111
 
class AppendA(TestCase):
 
111
class AppendA(TestBase):
112
112
    def runTest(self):
113
113
        m3 = Merge3(['aaa\n', 'bbb\n'],
114
114
                    ['aaa\n', 'bbb\n', '222\n'],
117
117
        self.assertEquals(''.join(m3.merge_lines()),
118
118
                          'aaa\nbbb\n222\n')
119
119
 
120
 
class AppendB(TestCase):
 
120
class AppendB(TestBase):
121
121
    def runTest(self):
122
122
        m3 = Merge3(['aaa\n', 'bbb\n'],
123
123
                    ['aaa\n', 'bbb\n'],
126
126
        self.assertEquals(''.join(m3.merge_lines()),
127
127
                          'aaa\nbbb\n222\n')
128
128
 
129
 
class AppendAgreement(TestCase):
 
129
class AppendAgreement(TestBase):
130
130
    def runTest(self):
131
131
        m3 = Merge3(['aaa\n', 'bbb\n'],
132
132
                    ['aaa\n', 'bbb\n', '222\n'],
135
135
        self.assertEquals(''.join(m3.merge_lines()),
136
136
                          'aaa\nbbb\n222\n')
137
137
 
138
 
class AppendClash(TestCase):
 
138
class AppendClash(TestBase):
139
139
    def runTest(self):
140
140
        m3 = Merge3(['aaa\n', 'bbb\n'],
141
141
                    ['aaa\n', 'bbb\n', '222\n'],
158
158
''')
159
159
 
160
160
 
161
 
class InsertAgreement(TestCase):
 
161
class InsertAgreement(TestBase):
162
162
    def runTest(self):
163
163
        m3 = Merge3(['aaa\n', 'bbb\n'],
164
164
                    ['aaa\n', '222\n', 'bbb\n'],
175
175
 
176
176
 
177
177
 
178
 
class InsertClash(TestCase):
 
178
class InsertClash(TestBase):
179
179
    """Both try to insert lines in the same place."""
180
180
    def runTest(self):
181
181
        m3 = Merge3(['aaa\n', 'bbb\n'],
218
218
 
219
219
 
220
220
 
221
 
class ReplaceClash(TestCase):
 
221
class ReplaceClash(TestBase):
222
222
    """Both try to insert lines in the same place."""
223
223
    def runTest(self):
224
224
        m3 = Merge3(['aaa', '000', 'bbb'],
235
235
 
236
236
 
237
237
 
238
 
class ReplaceMulti(TestCase):
 
238
class ReplaceMulti(TestBase):
239
239
    """Replacement with regions of different size."""
240
240
    def runTest(self):
241
241
        m3 = Merge3(['aaa', '000', '000', 'bbb'],
334
334
 
335
335
 
336
336
 
337
 
class MergePoem(TestCase):
 
337
class MergePoem(TestBase):
338
338
    """Test case from diff3 manual"""
339
339
    def runTest(self):
340
340
        m3 = Merge3(TZU, LAO, TAO)