~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: Martin Pool
  • Date: 2010-02-25 06:17:27 UTC
  • mfrom: (5055 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5057.
  • Revision ID: mbp@sourcefrog.net-20100225061727-4sd9lt0qmdc6087t
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
45
45
from bzrlib.revisiontree import RevisionTree
46
46
from bzrlib.revisionspec import RevisionSpec
47
47
 
 
48
from bzrlib.tests.test_win32utils import BackslashDirSeparatorFeature
 
49
 
48
50
 
49
51
class _AttribFeature(Feature):
50
52
 
1292
1294
            diff_obj.command_template)
1293
1295
 
1294
1296
    def test_from_string_u5(self):
1295
 
        diff_obj = DiffFromTool.from_string('diff -u\\ 5', None, None, None)
 
1297
        diff_obj = DiffFromTool.from_string('diff "-u 5"', None, None, None)
1296
1298
        self.addCleanup(diff_obj.finish)
1297
1299
        self.assertEqual(['diff', '-u 5', '@old_path', '@new_path'],
1298
1300
                         diff_obj.command_template)
1299
1301
        self.assertEqual(['diff', '-u 5', 'old-path', 'new-path'],
1300
1302
                         diff_obj._get_command('old-path', 'new-path'))
 
1303
        
 
1304
    def test_from_string_path_with_backslashes(self):
 
1305
        self.requireFeature(BackslashDirSeparatorFeature)
 
1306
        tool = 'C:\\Tools\\Diff.exe'
 
1307
        diff_obj = DiffFromTool.from_string(tool, None, None, None)
 
1308
        self.addCleanup(diff_obj.finish)
 
1309
        self.assertEqual(['C:\\Tools\\Diff.exe', '@old_path', '@new_path'],
 
1310
                         diff_obj.command_template)
 
1311
        self.assertEqual(['C:\\Tools\\Diff.exe', 'old-path', 'new-path'],
 
1312
                         diff_obj._get_command('old-path', 'new-path'))
1301
1313
 
1302
1314
    def test_execute(self):
1303
1315
        output = StringIO()