~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_cache_utf8.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-08 23:10:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2294.
  • Revision ID: john@arbash-meinel.com-20070208231037-xzuzlh339rmgfhk6
Add a get_cached_utf8, which will ensure it is really utf8, and cache the strings

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        self.failUnless(xp is x)
82
82
        self.failUnless(xp is yp)
83
83
 
 
84
    def test_cached_utf8(self):
 
85
        x = u'\xb5yy\xe5zz'.encode('utf8')
 
86
        y = u'\xb5yy\xe5zz'.encode('utf8')
 
87
        self.failIf(x is y)
 
88
        xp = cache_utf8.get_cached_utf8(x)
 
89
        yp = cache_utf8.get_cached_utf8(y)
 
90
 
 
91
        self.failUnless(xp is x)
 
92
        self.failUnless(xp is yp)