~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: Aaron Bentley
  • Date: 2006-04-19 02:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1673.
  • Revision ID: aaron.bentley@utoronto.ca-20060419021605-7f28e84382ceef4d
Apply merge review suggestions

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from bzrlib.tests import TestCase
6
6
 
7
7
 
8
 
def udiff_lines(old, new):
 
8
def udiff_lines(old, new, allow_binary=False):
9
9
    output = StringIO()
10
 
    internal_diff('old', old, 'new', new, output)
 
10
    internal_diff('old', old, 'new', new, output, allow_binary)
11
11
    output.seek(0, 0)
12
12
    return output.readlines()
13
13
 
54
54
    def test_binary_lines(self):
55
55
        self.assertRaises(BinaryFile, udiff_lines, [1023 * 'a' + '\x00'], [])
56
56
        self.assertRaises(BinaryFile, udiff_lines, [], [1023 * 'a' + '\x00'])
57
 
        udiff_lines([1024 * 'a' + '\x00'], [])
58
 
        udiff_lines([], [1024 * 'a' + '\x00'])
 
57
        udiff_lines([1023 * 'a' + '\x00'], [], allow_binary=True)
 
58
        udiff_lines([], [1023 * 'a' + '\x00'], allow_binary=True)