~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:11:54 UTC
  • mfrom: (2766 +trunk)
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830081154-16hebp2xwr15x2hc
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
498
498
        self.assertContainsRe(diff, r"--- a/%s" % (omega_utf8,))
499
499
        self.assertContainsRe(diff, r"\+\+\+ b/%s" % (omega_utf8,))
500
500
 
 
501
    def test_unicode_filename(self):
 
502
        """Test when the filename are unicode."""
 
503
        self.requireFeature(UnicodeFilename)
 
504
 
 
505
        alpha, omega = u'\u03b1', u'\u03c9'
 
506
        autf8, outf8 = alpha.encode('utf8'), omega.encode('utf8')
 
507
 
 
508
        tree = self.make_branch_and_tree('tree')
 
509
        self.build_tree_contents([('tree/ren_'+alpha, 'contents\n')])
 
510
        tree.add(['ren_'+alpha], ['file-id-2'])
 
511
        self.build_tree_contents([('tree/del_'+alpha, 'contents\n')])
 
512
        tree.add(['del_'+alpha], ['file-id-3'])
 
513
        self.build_tree_contents([('tree/mod_'+alpha, 'contents\n')])
 
514
        tree.add(['mod_'+alpha], ['file-id-4'])
 
515
 
 
516
        tree.commit('one', rev_id='rev-1')
 
517
 
 
518
        tree.rename_one('ren_'+alpha, 'ren_'+omega)
 
519
        tree.remove('del_'+alpha)
 
520
        self.build_tree_contents([('tree/add_'+alpha, 'contents\n')])
 
521
        tree.add(['add_'+alpha], ['file-id'])
 
522
        self.build_tree_contents([('tree/mod_'+alpha, 'contents_mod\n')])
 
523
 
 
524
        diff = self.get_diff(tree.basis_tree(), tree)
 
525
        self.assertContainsRe(diff,
 
526
                "=== renamed file 'ren_%s' => 'ren_%s'\n"%(autf8, outf8))
 
527
        self.assertContainsRe(diff, "=== added file 'add_%s'"%autf8)
 
528
        self.assertContainsRe(diff, "=== modified file 'mod_%s'"%autf8)
 
529
        self.assertContainsRe(diff, "=== removed file 'del_%s'"%autf8)
501
530
 
502
531
class TestPatienceDiffLib(TestCase):
503
532