~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__chunks_to_lines.py

  • Committer: John Arbash Meinel
  • Date: 2008-12-11 19:31:01 UTC
  • mto: This revision was merged to the branch mainline in revision 3895.
  • Revision ID: john@arbash-meinel.com-20081211193101-q0utq7jeh79vpmgr
Add a few more corner cases, some suggested by Robert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
                                 alreadly_lines=True)
72
72
        self.assertChunksToLines(['foo\n', 'bar\n', '\n', 'baz\n', '\n', '\n'],
73
73
                                 ['foo\nbar\n\nbaz\n\n\n'])
 
74
        self.assertChunksToLines(['foobarbaz'], ['foobarbaz'],
 
75
                                 alreadly_lines=True)
 
76
        self.assertChunksToLines(['foobarbaz'], ['foo', 'bar', 'baz'])
 
77
 
 
78
    def test_newlines(self):
 
79
        self.assertChunksToLines(['\n'], ['\n'], alreadly_lines=True)
 
80
        self.assertChunksToLines(['\n'], ['', '\n', ''])
 
81
        self.assertChunksToLines(['\n'], ['\n', ''])
 
82
        self.assertChunksToLines(['\n'], ['', '\n'])
 
83
        self.assertChunksToLines(['\n', '\n', '\n'], ['\n\n\n'])
 
84
        self.assertChunksToLines(['\n', '\n', '\n'], ['\n', '\n', '\n'],
 
85
                                 alreadly_lines=True)
74
86
 
75
87
    def test_lines_to_lines(self):
76
88
        self.assertChunksToLines(['foo\n', 'bar\r\n', 'ba\rz\n'],