~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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()