summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2006-03-30 10:54:07 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2006-03-30 10:54:07 (GMT)
commit67b6d516ce51734e6633bbae690885ed41b38e82 (patch)
treed0f3e0d4c0f80cead5abe7783e0e98092dfe93a0
parent262c00a21e4fff85b8d4cad95256684fa219d5e2 (diff)
downloadcpython-67b6d516ce51734e6633bbae690885ed41b38e82.zip
cpython-67b6d516ce51734e6633bbae690885ed41b38e82.tar.gz
cpython-67b6d516ce51734e6633bbae690885ed41b38e82.tar.bz2
Fixed bug #1459029 - unicode reprs were double-escaped.
-rw-r--r--Lib/test/test_unicode.py16
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)