diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-08-13 04:35:34 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-08-13 04:35:34 (GMT) |
commit | be66287e2055cbf7bf507b0fdc76c1cd738d880d (patch) | |
tree | fcc5dec436eaec4f30002d1c408e0a3818767517 /Lib/test/test_pep3131.py | |
parent | f413b80806bb7d077a1611610273dab6d916908d (diff) | |
download | cpython-be66287e2055cbf7bf507b0fdc76c1cd738d880d.zip cpython-be66287e2055cbf7bf507b0fdc76c1cd738d880d.tar.gz cpython-be66287e2055cbf7bf507b0fdc76c1cd738d880d.tar.bz2 |
normalization is different between unicode builds, so use a new non-BMP char and add normalization test
Diffstat (limited to 'Lib/test/test_pep3131.py')
-rw-r--r-- | Lib/test/test_pep3131.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/test/test_pep3131.py b/Lib/test/test_pep3131.py index ed7558a..df0f64d 100644 --- a/Lib/test/test_pep3131.py +++ b/Lib/test/test_pep3131.py @@ -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: |