~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-23 19:25:01 UTC
  • mto: This revision was merged to the branch mainline in revision 4522.
  • Revision ID: john@arbash-meinel.com-20090623192501-qzf1a07g8gxzkrxl
Add tests tha left-matching-blocks gets populated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1372
1372
        # they do not have compression children of their own.
1373
1373
        self.assertEqual({}, ann._content_objects)
1374
1374
 
 
1375
    def test__expand_delta_records_blocks(self):
 
1376
        ann = self.make_annotator()
 
1377
        rev_key = ('rev-id',)
 
1378
        parent_key = ('parent-id',)
 
1379
        record = ['0,1,1\n', 'new-line\n']
 
1380
        details = ('line-delta', True)
 
1381
        ann._num_compression_children[parent_key] = 2
 
1382
        ann._expand_record(parent_key, (), None,
 
1383
                           ['line1\n', 'line2\n', 'line3\n'],
 
1384
                           ('fulltext', False))
 
1385
        ann._expand_record(rev_key, (parent_key,), parent_key, record, details)
 
1386
        self.assertEqual({rev_key: [(1, 1, 1), (3, 3, 0)]},
 
1387
                         ann._left_matching_blocks)
 
1388
        rev2_key = ('rev2-id',)
 
1389
        record = ['0,1,1\n', 'new-line\n']
 
1390
        details = ('line-delta', False)
 
1391
        ann._expand_record(rev2_key, (parent_key,), parent_key, record, details)
 
1392
        self.assertEqual([(1, 1, 2), (3, 3, 0)],
 
1393
                         ann._left_matching_blocks[rev2_key])
 
1394
 
1375
1395
    def test__process_pending(self):
1376
1396
        ann = self.make_annotator()
1377
1397
        rev_key = ('rev-id',)