~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testweave.py

  • Committer: Martin Pool
  • Date: 2005-06-28 06:58:34 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050628065834-e84e97c4c0114dae
Add test for extracting from weave with nested insertions

Fix nested insertion processing

Check that stack is emptied at end of weave

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
                          (1, 'line 2'),
160
160
                          (4, 'ccc')])
161
161
 
 
162
 
 
163
 
 
164
class InsertNested(TestBase):
 
165
    """Insertion with nested instructions."""
 
166
    def runTest(self):
 
167
        k = Weave()
 
168
 
 
169
        k._v = [VerInfo([]),
 
170
                VerInfo([0]),
 
171
                VerInfo([0]),
 
172
                ]
 
173
        k._l = [('{', 0),
 
174
                'foo {',
 
175
                ('{', 1),
 
176
                '  added in version 1',
 
177
                ('}', 1),
 
178
                '}',
 
179
                ('}', 0)]
 
180
 
 
181
        self.assertEqual(k.get(0),
 
182
                         ['foo {',
 
183
                          '}'])
 
184
 
 
185
        self.assertEqual(k.get(1),
 
186
                         ['foo {',
 
187
                          '  added in version 1',
 
188
                          '}'])
 
189
                       
 
190
        
 
191
 
162
192
class DeleteLines(TestBase):
163
193
    """Test recording revisions that delete lines.
164
194