]> granicus.if.org Git - python/commitdiff
Fixed bug #1459029 - unicode reprs were double-escaped.
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 30 Mar 2006 10:54:07 +0000 (10:54 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 30 Mar 2006 10:54:07 +0000 (10:54 +0000)
Lib/test/test_unicode.py

index 49ef29df0096697437ec722e2146a2996ec84a06..c7113b5b4eb89e2415ff8b07db58d8eda415bc69 100644 (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)