Fixed bug #1459029 - unicode reprs were double-escaped.

This commit is contained in:
Anthony Baxter 2006-03-30 10:54:07 +00:00
parent 262c00a21e
commit 67b6d516ce
1 changed files with 16 additions and 0 deletions

View File

@ -810,6 +810,22 @@ class UnicodeTest(
self.assertEqual(str(Foo9("foo")), "string")
self.assertEqual(unicode(Foo9("foo")), u"not unicode")
def test_unicode_repr(self):
class s1:
def __repr__(self):
return '\\n'
class s2:
def __repr__(self):
return u'\\n'
self.assertEqual(repr(s1()), '\\n')
self.assertEqual(repr(s2()), '\\n')
def test_main():
test_support.run_unittest(UnicodeTest)