~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_diff.py

  • Committer: Alexander Belchenko
  • Date: 2006-12-13 08:15:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2204.
  • Revision ID: bialix@ukr.net-20061213081554-hglev5j0rzv0xhon
Provide tests to illustrate bug #55276 on win32.

Change blackbox tests for cat and bundle commands
to use run_bzr_subprocess and therefore grab
real output (windows mangle line-endings LF -> CRLF).
Also provide new blackbox tests for diff command.

To check that tests failed you need to run on win32:

python bzr selftest blackbox.test_cat
python bzr selftest blackbox.test_bundle
python bzr selftest blackbox.test_diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
294
294
                                   "+++ goodbye\t")
295
295
        self.assertEndsWith(out, "\n@@ -0,0 +1 @@\n"
296
296
                                 "+baz\n\n")
 
297
 
 
298
 
 
299
class TestDiffOutput(DiffBase):
 
300
 
 
301
    def test_diff_output(self):
 
302
        # check that output don't mangle line-endings
 
303
        self.make_example_branch()
 
304
        file('hello', 'wb').write('hello world!\n')
 
305
        output = self.run_bzr_subprocess('diff', retcode=1)[0]
 
306
        self.assert_('\n+hello world!\n' in output)