1
# Copyright (C) 2005-2010 Canonical Ltd
1
# Copyright (C) 2005, 2006 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
1294
1292
diff_obj.command_template)
1296
1294
def test_from_string_u5(self):
1297
diff_obj = DiffFromTool.from_string('diff "-u 5"', None, None, None)
1295
diff_obj = DiffFromTool.from_string('diff -u\\ 5', None, None, None)
1298
1296
self.addCleanup(diff_obj.finish)
1299
1297
self.assertEqual(['diff', '-u 5', '@old_path', '@new_path'],
1300
1298
diff_obj.command_template)
1301
1299
self.assertEqual(['diff', '-u 5', 'old-path', 'new-path'],
1302
1300
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'))
1314
1302
def test_execute(self):
1315
1303
output = StringIO()