~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_index.py

  • Committer: Robert Collins
  • Date: 2007-07-13 20:00:06 UTC
  • mto: (2592.3.12 repository)
  • mto: This revision was merged to the branch mainline in revision 2624.
  • Revision ID: robertc@robertcollins.net-20070713200006-ollxheg4pu5m9wf1
Bugfix incorrect offset generation when an absent record is before a referenced record.

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
        builder.add_node('key', (['reference'], ), 'data')
216
216
        builder.add_node('reference', ([],), 'data')
217
217
 
 
218
    def test_absent_has_no_reference_overhead(self):
 
219
        # the offsets after an absent record should be correct when there are
 
220
        # >1 reference lists.
 
221
        builder = GraphIndexBuilder(reference_lists=2)
 
222
        builder.add_node('parent', (['tail', 'other'], []), '')
 
223
        stream = builder.finish()
 
224
        contents = stream.read()
 
225
        self.assertEqual("Bazaar Graph Index 1\nnode_ref_lists=2\n"
 
226
            "tail\x00a\x00\x00\n"
 
227
            "parent\x00\x0038\r63\t\x00\n"
 
228
            "other\x00a\x00\x00\n"
 
229
            "\n", contents)
 
230
 
218
231
 
219
232
class TestGraphIndex(TestCaseWithMemoryTransport):
220
233