1
# Copyright (C) 2005, 2006 Canonical Ltd
1
# Copyright (C) 2005-2010 Canonical Ltd
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
1292
1294
diff_obj.command_template)
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'))
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'))
1302
1314
def test_execute(self):
1303
1315
output = StringIO()