]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
normalization is different between unicode builds, so use a new non-BMP char and...
authorBenjamin Peterson <benjamin@python.org>
Sat, 13 Aug 2011 04:35:34 +0000 (23:35 -0500)
committerBenjamin Peterson <benjamin@python.org>
Sat, 13 Aug 2011 04:35:34 +0000 (23:35 -0500)
Lib/test/test_pep3131.py

index ed7558a7eec7ba1a9e42c1b5870d70ae74cc75a9..df0f64d86aca72073131ceeae9acd2b519eab5a1 100644 (file)
@@ -1,4 +1,5 @@
 import unittest
+import sys
 from test import support
 
 class PEP3131Test(unittest.TestCase):
@@ -8,12 +9,20 @@ class PEP3131Test(unittest.TestCase):
             รค = 1
             ยต = 2 # this is a compatibility character
             ่Ÿ’ = 3
-            ๐”˜๐”ซ๐”ฆ๐” ๐”ฌ๐”ก๐”ข  = 4
+            x๓ „€ = 4
         self.assertEqual(getattr(T, "\xe4"), 1)
         self.assertEqual(getattr(T, "\u03bc"), 2)
         self.assertEqual(getattr(T, '\u87d2'), 3)
-        v = getattr(T, "\U0001d518\U0001d52b\U0001d526\U0001d520\U0001d52c\U0001d521\U0001d522")
-        self.assertEqual(v, 4)
+        self.assertEqual(getattr(T, 'x\U000E0100'), 4)
+
+    def test_non_bmp_normalized(self):
+        ๐”˜๐”ซ๐”ฆ๐” ๐”ฌ๐”ก๐”ข = 1
+        # On wide builds, this is normalized, but on narrow ones it is not. See
+        # #12746.
+        try:
+            self.assertIn("๐”˜๐”ซ๐”ฆ๐” ๐”ฌ๐”ก๐”ข", dir())
+        except AssertionError:
+            raise unittest.case._ExpectedFailure(sys.exc_info())
 
     def test_invalid(self):
         try: