~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testknit.py

  • Committer: Martin Pool
  • Date: 2005-06-27 08:27:15 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050627082715-900eed098cccef9e
Fix insertion of multiple regions, calculating the right line offset as we go.

Add test for this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
                          (3, 'middle line'),
145
145
                          (1, 'line 2')])
146
146
 
 
147
        # now multiple insertions at different places
 
148
        k.add([0, 1, 3],
 
149
              ['line 1', 'aaa', 'middle line', 'bbb', 'line 2', 'ccc'])
 
150
 
 
151
        self.assertEqual(k.annotate(4), 
 
152
                         [(0, 'line 1'),
 
153
                          (4, 'aaa'),
 
154
                          (3, 'middle line'),
 
155
                          (4, 'bbb'),
 
156
                          (1, 'line 2'),
 
157
                          (4, 'ccc')])
147
158
 
148
159
class DeleteLines(TestBase):
149
160
    """Test recording revisions that delete lines.