~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tests/test_groupcompress.py

Encode copy ranges as bytes not lines, halves decode overhead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
            'label: newlabel\n',
86
86
            'sha1: %s\n' % sha1_2,
87
87
            # copy the line common
88
 
            'c,4,1\n',
 
88
            'c,72,7\n',
89
89
            # add the line different
90
90
            'i,1\n',
91
91
            'different\n',
92
92
            # copy the line \n. Note that when we filter on encoding-overhead
93
93
            # this will become a fresh insert instead
94
 
            'c,5,1\n',
 
94
            'c,79,1\n',
95
95
            ])
96
96
        self.assertEqual(expected_lines, compressor.lines)
97
97
        self.assertEqual(sum(map(len, expected_lines)), end_point)
117
117
            'i,1\n',
118
118
            'new\n',
119
119
            # copy the line common
120
 
            'c,4,1\n',
 
120
            'c,72,7\n',
121
121
            # copy the lines different, moredifferent
122
 
            'c,10,2\n',
 
122
            'c,154,24\n',
123
123
            # copy the line \n. Note that when we filter on encoding-overhead
124
124
            # this will become a fresh insert instead
125
 
            'c,5,1\n',
 
125
            'c,79,1\n',
126
126
            ])
127
127
        self.assertEqualDiff(''.join(expected_lines), ''.join(compressor.lines))
128
128
        self.assertEqual(sum(map(len, expected_lines)), end_point)