summaryrefslogtreecommitdiff
path: root/Lib/test/test_unicodedata.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-23 02:27:37 +0000
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-23 02:27:37 +0000
commitc1f56d45b699a049497c3b0348435dc800b1a0a7 (patch)
treed95be460b36a91ac39fd161a9aea94babd50b298 /Lib/test/test_unicodedata.py
parent0ed24380ce461987a6d3cdc8f6d73373a31e61b1 (diff)
downloadcpython-c1f56d45b699a049497c3b0348435dc800b1a0a7.tar.gz
Issue #10254: Fixed a crash and a regression introduced by the implementation of PRI 29.
Diffstat (limited to 'Lib/test/test_unicodedata.py')
-rw-r--r--Lib/test/test_unicodedata.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index 1cb36fe2c8..97442564e7 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -188,9 +188,22 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
def test_pr29(self):
# http://www.unicode.org/review/pr-29.html
- for text in ("\u0b47\u0300\u0b3e", "\u1100\u0300\u1161"):
+ # See issues #1054943 and #10254.
+ composed = ("\u0b47\u0300\u0b3e", "\u1100\u0300\u1161",
+ 'Li\u030dt-s\u1e73\u0301',
+ '\u092e\u093e\u0930\u094d\u0915 \u091c\u093c'
+ + '\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917',
+ '\u0915\u093f\u0930\u094d\u0917\u093f\u091c\u093c'
+ + '\u0938\u094d\u0924\u093e\u0928')
+ for text in composed:
self.assertEqual(self.db.normalize('NFC', text), text)
+ def test_issue10254(self):
+ # Crash reported in #10254
+ a = 'C\u0338' * 20 + 'C\u0327'
+ b = 'C\u0338' * 20 + '\xC7'
+ self.assertEqual(self.db.normalize('NFC', a), b)
+
def test_east_asian_width(self):
eaw = self.db.east_asian_width
self.assertRaises(TypeError, eaw, b'a')