Fixed bug #1459029 - unicode reprs were double-escaped.
This commit is contained in:
parent
262c00a21e
commit
67b6d516ce
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue