~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_rio.py

  • Committer: Aaron Bentley
  • Date: 2007-03-02 15:03:07 UTC
  • mto: (2323.6.9 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2330.
  • Revision ID: abentley@panoramicfeedback.com-20070302150307-zg8n768fzowijv7l
Patch-RIO does line breaks in slightly more readable places

Show diffs side-by-side

added added

removed removed

Lines of Context:
364
364
        return new_lines
365
365
 
366
366
    def test_patch_rio(self):
367
 
        stanza = Stanza(data='#\n\r\\r ', space=' ' * 255)
 
367
        stanza = Stanza(data='#\n\r\\r ', space=' ' * 255, hash='#' * 255)
368
368
        lines = rio.to_patch_lines(stanza)
369
369
        for line in lines:
370
370
            self.assertContainsRe(line, '^# ')
375
375
        new_stanza = rio.read_patch_stanza(lines)
376
376
        self.assertEqual('#\n\r\\r ', new_stanza.get('data'))
377
377
        self.assertEqual(' '* 255, new_stanza.get('space'))
 
378
        self.assertEqual('#'* 255, new_stanza.get('hash'))
 
379
 
 
380
    def test_patch_rio_linebreaks(self):
 
381
        stanza = Stanza(breaktest='linebreak -/'*30)
 
382
        self.assertContainsRe(rio.to_patch_lines(stanza, 71)[0],
 
383
                              'linebreak\\\\\n')
 
384
        stanza = Stanza(breaktest='linebreak-/'*30)
 
385
        self.assertContainsRe(rio.to_patch_lines(stanza, 70)[0],
 
386
                              'linebreak-\\\\\n')
 
387
        stanza = Stanza(breaktest='linebreak/'*30)
 
388
        self.assertContainsRe(rio.to_patch_lines(stanza, 70)[0],
 
389
                              'linebreak\\\\\n')