diff options
author | Anthony Baxter <anthonybaxter@gmail.com> | 2006-03-30 10:54:07 (GMT) |
---|---|---|
committer | Anthony Baxter <anthonybaxter@gmail.com> | 2006-03-30 10:54:07 (GMT) |
commit | 67b6d516ce51734e6633bbae690885ed41b38e82 (patch) | |
tree | d0f3e0d4c0f80cead5abe7783e0e98092dfe93a0 /Lib/test/test_unicode.py | |
parent | 262c00a21e4fff85b8d4cad95256684fa219d5e2 (diff) | |
download | cpython-67b6d516ce51734e6633bbae690885ed41b38e82.zip cpython-67b6d516ce51734e6633bbae690885ed41b38e82.tar.gz cpython-67b6d516ce51734e6633bbae690885ed41b38e82.tar.bz2 |
Fixed bug #1459029 - unicode reprs were double-escaped.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 49ef29d..c7113b5 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -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) |